Fixes for voting on proposals. 0 for no voting option. Set default value in migration to avoid blank/null problems.

This commit is contained in:
Stella 2013-12-28 15:29:50 +02:00
parent 125d5fe3ff
commit de1ed9be2b
3 changed files with 10 additions and 2 deletions

View file

@ -3,6 +3,6 @@ class CallForPapers < ActiveRecord::Base
belongs_to :conference
validates_presence_of :start_date, :end_date, :hard_deadline
validates :rating, :numericality => { :greater_than_or_equal_to => 1, :less_than_or_equal_to => 10 }
validates :rating, :numericality => { :greater_than_or_equal_to => 0, :less_than_or_equal_to => 10 }
end

View file

@ -9,6 +9,6 @@
= f.input :hard_deadline, :as => :string, :input_html => { :id => "cfp-hard-datepicker", :readonly => "readonly" }
= f.input :description, :hint => "Welcome text for the Call for Papers"
= f.input :schedule_changes
= f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals."
= f.input :rating, :hint => "Enter the number of different rating levels you want to have for voting on proposals. Enter 0 if you do not want to vote on proposals."
= f.input :rating_desc, :label => "Rating Description", :hint => "Enter comments about voting process.", :input_html => {:value => "1 is for 'I don't like this proposal',\n2 is for 'I am ok with this proposal.',\n3 is for 'I love this proposal!'", :rows => 5, :class => "span6"}
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}

View file

@ -0,0 +1,8 @@
class ChangeDefaultRatingInCallForPapers < ActiveRecord::Migration
def up
change_column :call_for_papers, :rating, :integer, :default => 3
end
def down
end
end