add highlights and fix cfp in splashpage
This commit is contained in:
parent
8e25338436
commit
ecfc348ea8
17 changed files with 111 additions and 32 deletions
5
db/migrate/20141127161313_add_is_highlight_in_events.rb
Normal file
5
db/migrate/20141127161313_add_is_highlight_in_events.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddIsHighlightInEvents < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :events, :is_highlight, :boolean, default: false
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
class MigrateDataRemoveColumnIncludeCfpInSplashAddColumnIncludeCfp < ActiveRecord::Migration
|
||||
class TempConference < ActiveRecord::Base
|
||||
self.table_name = 'conferences'
|
||||
end
|
||||
|
||||
class TempCallForPaper< ActiveRecord::Base
|
||||
self.table_name = 'call_for_papers'
|
||||
end
|
||||
|
||||
class TempSplashpage < ActiveRecord::Base
|
||||
self.table_name = 'splashpages'
|
||||
attr_accessible :conference_id
|
||||
end
|
||||
|
||||
def up
|
||||
add_column :splashpages, :include_cfp, :boolean, default: false
|
||||
|
||||
TempConference.all.each do |conference|
|
||||
cfp = TempCallForPaper.find_by(conference_id: conference.id)
|
||||
|
||||
if cfp && cfp.include_cfp_in_splash
|
||||
splashpage = TempSplashpage.find_or_initialize_by(conference_id: conference.id)
|
||||
splashpage.include_cfp = cfp.include_cfp_in_splash # true
|
||||
splashpage.save!
|
||||
end
|
||||
end
|
||||
|
||||
remove_column :call_for_papers, :include_cfp_in_splash, :boolean, default: false
|
||||
end
|
||||
|
||||
def down
|
||||
add_column :call_for_papers, :include_cfp_in_splash, :boolean, default: false
|
||||
|
||||
TempConference.all.each do |conference|
|
||||
splashpage = TempSplashpage.find_by(conference_id: conference.id)
|
||||
cfp = TempCallForPaper.find_by(conference_id: conference.id)
|
||||
|
||||
if splashpage && cfp
|
||||
cfp.include_cfp_in_splash = splashpage.include_cfp
|
||||
cfp.save!
|
||||
end
|
||||
end
|
||||
|
||||
remove_column :splashpages, :include_cfp, :boolean, default: false
|
||||
end
|
||||
end
|
||||
11
db/schema.rb
11
db/schema.rb
|
|
@ -32,15 +32,14 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
|||
end
|
||||
|
||||
create_table "call_for_papers", force: true do |t|
|
||||
t.date "start_date", null: false
|
||||
t.date "end_date", null: false
|
||||
t.date "start_date", null: false
|
||||
t.date "end_date", null: false
|
||||
t.integer "conference_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "schedule_changes", default: false
|
||||
t.integer "rating", default: 3
|
||||
t.boolean "schedule_changes", default: false
|
||||
t.integer "rating", default: 3
|
||||
t.boolean "schedule_public"
|
||||
t.boolean "include_cfp_in_splash", default: false
|
||||
end
|
||||
|
||||
create_table "campaigns", force: true do |t|
|
||||
|
|
@ -234,6 +233,7 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
|||
t.boolean "require_registration"
|
||||
t.integer "difficulty_level_id"
|
||||
t.integer "week"
|
||||
t.boolean "is_highlight", default: false
|
||||
end
|
||||
|
||||
create_table "events_registrations", id: false, force: true do |t|
|
||||
|
|
@ -378,6 +378,7 @@ ActiveRecord::Schema.define(version: 20141130182139) do
|
|||
t.boolean "include_lodgings"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.boolean "include_cfp", default: false
|
||||
end
|
||||
|
||||
create_table "sponsors", force: true do |t|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue