diff --git a/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb b/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb new file mode 100644 index 000000000..2675d9fa7 --- /dev/null +++ b/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb @@ -0,0 +1,5 @@ +class AddLocaleToSiteCustomizationPages < ActiveRecord::Migration + def change + add_column :site_customization_pages, :locale, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 4cfa7229f..ef7abce74 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: 20170620132731) do +ActiveRecord::Schema.define(version: 20170702105956) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -791,6 +791,7 @@ ActiveRecord::Schema.define(version: 20170620132731) do t.string "status", default: "draft" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "locale" end create_table "spending_proposals", force: :cascade do |t| diff --git a/lib/tasks/settings.rake b/lib/tasks/settings.rake index 29dc256bb..61c5fd5c0 100644 --- a/lib/tasks/settings.rake +++ b/lib/tasks/settings.rake @@ -4,7 +4,7 @@ namespace :settings do task per_page_code_migration: :environment do per_page_code_setting = Setting.where(key: 'per_page_code').first - Setting['per_page_code_head'] = per_page_code_setting&.value.to_s if Setting.where(key: 'per_page_code_head').first.blank? + Setting['per_page_code_head'] = per_page_code_setting.value.to_s if Setting.where(key: 'per_page_code_head').first.blank? per_page_code_setting.destroy if per_page_code_setting.present? end