cirandas.net

ref: master

db/migrate/20110714213405_symbolize_environment_settings_keys.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class SymbolizeEnvironmentSettingsKeys < ActiveRecord::Migration
  def self.up
    select_all("select id from environments").each do |environment|
      env = Environment.find(environment['id'])
      env.settings.symbolize_keys!
      env.save_without_validation
    end
  end

  def self.down
    say "WARNING: cannot undo this migration"
  end
end