diff --git a/app/models/call_for_papers.rb b/app/models/call_for_papers.rb index b8eaeddd..91e8e945 100644 --- a/app/models/call_for_papers.rb +++ b/app/models/call_for_papers.rb @@ -1,10 +1,10 @@ class CallForPapers < ActiveRecord::Base - attr_accessible :start_date, :end_date, :hard_deadline, + attr_accessible :start_date, :end_date, :description, :schedule_changes, :rating, :schedule_public belongs_to :conference - validates_presence_of :start_date, :end_date, :hard_deadline + validates_presence_of :start_date, :end_date validates :rating, :numericality => { :greater_than_or_equal_to => 0, :less_than_or_equal_to => 10 } ## diff --git a/app/views/admin/callforpapers/show.html.haml b/app/views/admin/callforpapers/show.html.haml index a600dac9..ea4b61f2 100644 --- a/app/views/admin/callforpapers/show.html.haml +++ b/app/views/admin/callforpapers/show.html.haml @@ -3,7 +3,6 @@ = semantic_form_for(@cfp, :url => admin_conference_callforpapers_path(@conference.short_title),:html => {:multipart => true}) do |f| = f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" } = f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" } - = 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 :schedule_public diff --git a/db/migrate/20140604142949_remove_hard_deadline_from_call_for_papers.rb b/db/migrate/20140604142949_remove_hard_deadline_from_call_for_papers.rb new file mode 100644 index 00000000..7d567199 --- /dev/null +++ b/db/migrate/20140604142949_remove_hard_deadline_from_call_for_papers.rb @@ -0,0 +1,9 @@ +class RemoveHardDeadlineFromCallForPapers < ActiveRecord::Migration + def up + remove_column :call_for_papers, :hard_deadline + end + + def down + add_column :call_for_papers, :hard_deadline, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index 9d4be48c..cdaa250a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140530082708) do +ActiveRecord::Schema.define(version: 20140604142949) do create_table "answers", force: true do |t| t.string "title" @@ -22,7 +22,6 @@ ActiveRecord::Schema.define(version: 20140530082708) do create_table "call_for_papers", force: true do |t| t.date "start_date", null: false t.date "end_date", null: false - t.date "hard_deadline", null: false t.text "description", null: false t.integer "conference_id" t.datetime "created_at" diff --git a/spec/factories/call_for_papers.rb b/spec/factories/call_for_papers.rb index 5bd5720b..1cf91c84 100644 --- a/spec/factories/call_for_papers.rb +++ b/spec/factories/call_for_papers.rb @@ -4,7 +4,6 @@ FactoryGirl.define do factory :call_for_papers do start_date Date.today - 1 end_date Date.today + 7 - hard_deadline Date.today + 8 description 'We call for papers' conference end diff --git a/spec/features/cfp_spec.rb b/spec/features/cfp_spec.rb index 6319e903..4c185872 100644 --- a/spec/features/cfp_spec.rb +++ b/spec/features/cfp_spec.rb @@ -19,16 +19,13 @@ feature Conference do expect(flash). to eq('Creating the call for papers failed. ' + - "Start date can't be blank. End date can't be blank. " + - "Hard deadline can't be blank.") + "Start date can't be blank. End date can't be blank.") today = Date.today - 1 page.execute_script( "$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')") page.execute_script( "$('#conference-end-datepicker').val('#{(today + 7).strftime('%d/%m/%Y')}')") - page.execute_script( - "$('#cfp-hard-datepicker').val('#{(today + 8).strftime('%d/%m/%Y')}')") fill_in 'call_for_papers_description', with: 'Cfp description' fill_in 'call_for_papers_rating', with: '4' @@ -42,8 +39,6 @@ feature Conference do to eq(today.strftime('%Y-%m-%d')) expect(find('#conference-end-datepicker').value). to eq((today + 7).strftime('%Y-%m-%d')) - expect(find('#cfp-hard-datepicker').value). - to eq((today + 8).strftime('%Y-%m-%d')) expect(find('#call_for_papers_description').text). to eq('Cfp description') expect(find('#call_for_papers_rating').value).to eq('4') @@ -73,8 +68,6 @@ feature Conference do "$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')") page.execute_script( "$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')") - page.execute_script( - "$('#cfp-hard-datepicker').val('#{(today + 28).strftime('%d/%m/%Y')}')") fill_in 'call_for_papers_description', with: 'Updated description' fill_in 'call_for_papers_rating', with: '0' @@ -87,8 +80,6 @@ feature Conference do to eq(today.strftime('%Y-%m-%d')) expect(find('#conference-end-datepicker').value). to eq((today + 14).strftime('%Y-%m-%d')) - expect(find('#cfp-hard-datepicker').value). - to eq((today + 28).strftime('%Y-%m-%d')) expect(find('#call_for_papers_description').text). to eq('Updated description') expect(find('#call_for_papers_rating').value).to eq('0') diff --git a/spec/views/admin/callforpapers/show.html.haml_spec.rb b/spec/views/admin/callforpapers/show.html.haml_spec.rb index 48824553..0584f623 100644 --- a/spec/views/admin/callforpapers/show.html.haml_spec.rb +++ b/spec/views/admin/callforpapers/show.html.haml_spec.rb @@ -6,7 +6,6 @@ describe 'admin/callforpapers/show' do assign :conference, @conference assign :cfp, stub_model(CallForPapers, start_date: Date.today, end_date: Date.today + 7.days, - hard_deadline: Date.today + 6.days, description: 'Lorem Ipsum Dolsum') render expect(rendered).to include("#{Date.today}")