diff --git a/app/controllers/trustie_hacks_controller.rb b/app/controllers/trustie_hacks_controller.rb index 803809124..22a7a2976 100644 --- a/app/controllers/trustie_hacks_controller.rb +++ b/app/controllers/trustie_hacks_controller.rb @@ -1,5 +1,5 @@ class TrustieHacksController < ApplicationController - before_action :require_admin, :except => [:index] + before_action :require_admin, :except => [:index, :entry] before_action :require_login, :except => [:index] before_action :find_hackathon before_action :find_hack, :except => [:create, :index, :edit_hackathon, :update_hackathon] diff --git a/app/models/trustie_hack.rb b/app/models/trustie_hack.rb index b436007ca..7c2f3264b 100644 --- a/app/models/trustie_hack.rb +++ b/app/models/trustie_hack.rb @@ -1,4 +1,5 @@ class TrustieHack < ApplicationRecord + validates_length_of :description, maximum: 500 has_many :hack_users, :dependent => :destroy belongs_to :trustie_hackathon, counter_cache: true diff --git a/app/models/trustie_hackathon.rb b/app/models/trustie_hackathon.rb index 7269e7856..65275099d 100644 --- a/app/models/trustie_hackathon.rb +++ b/app/models/trustie_hackathon.rb @@ -1,5 +1,5 @@ class TrustieHackathon < ApplicationRecord - + validates_length_of :description, maximum: 500 has_many :trustie_hacks, :dependent => :destroy end diff --git a/db/migrate/20191108070703_modify_descriotion_limit_for_hacks.rb b/db/migrate/20191108070703_modify_descriotion_limit_for_hacks.rb new file mode 100644 index 000000000..9168dbd2a --- /dev/null +++ b/db/migrate/20191108070703_modify_descriotion_limit_for_hacks.rb @@ -0,0 +1,6 @@ +class ModifyDescriotionLimitForHacks < ActiveRecord::Migration[5.2] + def change + change_column :trustie_hackathons, :description, :text + change_column :trustie_hacks, :description, :text + end +end