Commit b052d2801f68fa574f9971df3f6b6beeefe56f0a
1 parent
72253b6a
Exists in
master
and in
28 other branches
Added migration to symbolize environment settings
(ActionItem2048)
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
db/migrate/20110714213405_symbolize_environment_settings_keys.rb
0 → 100644
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +class SymbolizeEnvironmentSettingsKeys < ActiveRecord::Migration | ||
2 | + def self.up | ||
3 | + select_all("select id from environments").each do |environment| | ||
4 | + env = Environment.find(environment['id']) | ||
5 | + env.settings.symbolize_keys! | ||
6 | + env.save | ||
7 | + end | ||
8 | + end | ||
9 | + | ||
10 | + def self.down | ||
11 | + say "WARNING: cannot undo this migration" | ||
12 | + end | ||
13 | +end |
db/schema.rb
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | # | 9 | # |
10 | # It's strongly recommended to check this file into your version control system. | 10 | # It's strongly recommended to check this file into your version control system. |
11 | 11 | ||
12 | -ActiveRecord::Schema.define(:version => 20110706171330) do | 12 | +ActiveRecord::Schema.define(:version => 20110714213405) do |
13 | 13 | ||
14 | create_table "action_tracker", :force => true do |t| | 14 | create_table "action_tracker", :force => true do |t| |
15 | t.integer "user_id" | 15 | t.integer "user_id" |