From 6c5e04f51328616076acdfd6bacbdfa6d542f616 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Tue, 17 Jun 2014 20:25:35 +0530 Subject: [PATCH] Adds migrations for checkboxes of splash components --- app/models/call_for_papers.rb | 2 +- app/models/conference.rb | 5 +- app/models/venue.rb | 3 +- ...xes_for_splash_components_to_conference.rb | 10 ++++ ...nclude_cfp_in_splash_to_call_for_papers.rb | 5 ++ ...617145048_add_venue_checkboxes_to_venue.rb | 6 +++ db/schema.rb | 49 +++++++++++-------- 7 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 db/migrate/20140617140018_add_checkboxes_for_splash_components_to_conference.rb create mode 100644 db/migrate/20140617141918_add_include_cfp_in_splash_to_call_for_papers.rb create mode 100644 db/migrate/20140617145048_add_venue_checkboxes_to_venue.rb diff --git a/app/models/call_for_papers.rb b/app/models/call_for_papers.rb index 8900f47d..7581fed2 100644 --- a/app/models/call_for_papers.rb +++ b/app/models/call_for_papers.rb @@ -1,7 +1,7 @@ class CallForPapers < ActiveRecord::Base attr_accessible :start_date, :end_date, :description, :schedule_changes, :rating, - :schedule_public + :schedule_public, :include_cfp_in_splash belongs_to :conference validates_presence_of :start_date, :end_date diff --git a/app/models/conference.rb b/app/models/conference.rb index 6d48e314..558fa349 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -16,7 +16,10 @@ class Conference < ActiveRecord::Base :sponsorship_levels_attributes, :sponsors_attributes, :facebook_url, :google_url, :twitter_url, :sponsor_description, :sponsor_email, - :lodging_description + :lodging_description, :include_registrations_in_splash, + :include_sponsors_in_splash, :include_tracks_in_splash, + :include_tickets_in_splash, :include_social_media_in_splash, + :include_program_in_splash has_paper_trail diff --git a/app/models/venue.rb b/app/models/venue.rb index 020a57ff..abf6e22d 100644 --- a/app/models/venue.rb +++ b/app/models/venue.rb @@ -1,5 +1,6 @@ class Venue < ActiveRecord::Base - attr_accessible :name, :description, :website, :address, :photo, :lodgings_attributes + attr_accessible :name, :description, :website, :address, :photo, :lodgings_attributes, + :include_venue_in_splash, :include_lodgings_in_splash has_many :conferences has_many :lodgings before_create :generate_guid diff --git a/db/migrate/20140617140018_add_checkboxes_for_splash_components_to_conference.rb b/db/migrate/20140617140018_add_checkboxes_for_splash_components_to_conference.rb new file mode 100644 index 00000000..5822c6cd --- /dev/null +++ b/db/migrate/20140617140018_add_checkboxes_for_splash_components_to_conference.rb @@ -0,0 +1,10 @@ +class AddCheckboxesForSplashComponentsToConference < ActiveRecord::Migration + def change + add_column :conferences, :include_registrations_in_splash, :boolean, default: false + add_column :conferences, :include_sponsors_in_splash, :boolean, default: false + add_column :conferences, :include_tracks_in_splash, :boolean, default: false + add_column :conferences, :include_tickets_in_splash, :boolean, default: false + add_column :conferences, :include_social_media_in_splash, :boolean, default: false + add_column :conferences, :include_program_in_splash, :boolean, default: false + end +end diff --git a/db/migrate/20140617141918_add_include_cfp_in_splash_to_call_for_papers.rb b/db/migrate/20140617141918_add_include_cfp_in_splash_to_call_for_papers.rb new file mode 100644 index 00000000..415927e4 --- /dev/null +++ b/db/migrate/20140617141918_add_include_cfp_in_splash_to_call_for_papers.rb @@ -0,0 +1,5 @@ +class AddIncludeCfpInSplashToCallForPapers < ActiveRecord::Migration + def change + add_column :call_for_papers, :include_cfp_in_splash, :boolean, default: false + end +end diff --git a/db/migrate/20140617145048_add_venue_checkboxes_to_venue.rb b/db/migrate/20140617145048_add_venue_checkboxes_to_venue.rb new file mode 100644 index 00000000..eeb7bfea --- /dev/null +++ b/db/migrate/20140617145048_add_venue_checkboxes_to_venue.rb @@ -0,0 +1,6 @@ +class AddVenueCheckboxesToVenue < ActiveRecord::Migration + def change + add_column :venues, :include_venue_in_splash, :boolean, default: false + add_column :venues, :include_lodgings_in_splash, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 16717c99..030cce43 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: 20140614174354) do +ActiveRecord::Schema.define(version: 20140617145048) do create_table "answers", force: true do |t| t.string "title" @@ -20,15 +20,16 @@ ActiveRecord::Schema.define(version: 20140614174354) do end create_table "call_for_papers", force: true do |t| - t.date "start_date", null: false - t.date "end_date", null: false - t.text "description", null: false + t.date "start_date", null: false + t.date "end_date", null: false + t.text "description", 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 "comments", force: true do |t| @@ -50,15 +51,15 @@ ActiveRecord::Schema.define(version: 20140614174354) do add_index "comments", ["user_id"], name: "index_comments_on_user_id" create_table "conferences", force: true do |t| - t.string "guid", null: false - t.string "title", null: false - t.string "short_title", null: false + t.string "guid", null: false + t.string "title", null: false + t.string "short_title", null: false t.string "social_tag" - t.string "contact_email", null: false - t.string "timezone", null: false + t.string "contact_email", null: false + t.string "timezone", null: false t.string "html_export_path" - 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 "venue_id" t.datetime "created_at" t.datetime "updated_at" @@ -68,12 +69,12 @@ ActiveRecord::Schema.define(version: 20140614174354) do t.string "logo_content_type" t.integer "logo_file_size" t.datetime "logo_updated_at" - t.boolean "use_dietary_choices", default: false - t.boolean "use_supporter_levels", default: false + t.boolean "use_dietary_choices", default: false + t.boolean "use_supporter_levels", default: false t.integer "revision" - t.boolean "use_vpositions", default: false - t.boolean "use_vdays", default: false - t.boolean "use_difficulty_levels", default: false + t.boolean "use_vpositions", default: false + t.boolean "use_vdays", default: false + t.boolean "use_difficulty_levels", default: false t.boolean "use_volunteers" t.string "media_id" t.string "media_type" @@ -87,6 +88,12 @@ ActiveRecord::Schema.define(version: 20140614174354) do t.text "sponsor_description" t.string "sponsor_email" t.text "lodging_description" + t.boolean "include_registrations_in_splash", default: false + t.boolean "include_sponsors_in_splash", default: false + t.boolean "include_tracks_in_splash", default: false + t.boolean "include_tickets_in_splash", default: false + t.boolean "include_social_media_in_splash", default: false + t.boolean "include_program_in_splash", default: false end create_table "conferences_questions", id: false, force: true do |t| @@ -396,8 +403,8 @@ ActiveRecord::Schema.define(version: 20140614174354) do create_table "venues", force: true do |t| t.string "guid" - t.text "name", limit: 255 - t.text "address", limit: 255 + t.text "name", limit: 255 + t.text "address", limit: 255 t.string "website" t.text "description" t.string "offline_map_url" @@ -408,6 +415,8 @@ ActiveRecord::Schema.define(version: 20140614174354) do t.string "photo_content_type" t.integer "photo_file_size" t.datetime "photo_updated_at" + t.boolean "include_venue_in_splash", default: false + t.boolean "include_lodgings_in_splash", default: false end create_table "versions", force: true do |t|