Created migration to add locale to site_customization_pages

This commit is contained in:
María Checa
2017-07-02 14:47:13 +02:00
parent e5fc7de074
commit d5560ddabd
3 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
class AddLocaleToSiteCustomizationPages < ActiveRecord::Migration
def change
add_column :site_customization_pages, :locale, :string
end
end

View File

@@ -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|

View File

@@ -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