Sha256: dae437f4f9b71e536089ba7490b6aa3cddd76f55cbb79d17aa342d145fce2d53

Contents?: true

Size: 314 Bytes

Versions: 12

Compression:

Stored size: 314 Bytes

Contents

class StatesToString < ActiveRecord::Migration
  def change
    change_column :flyboy_goals, :status, :string
    Flyboy::Goal.where(status: "0").update_all(status: "pending")
    Flyboy::Goal.where(status: "1").update_all(status: "open")
    Flyboy::Goal.where(status: "2").update_all(status: "closed")
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
flyboy-1.1.0 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.7 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.6 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.5 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.4 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.3 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.2 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.1 db/migrate/20150407070804_states_to_string.rb
flyboy-1.0.0 db/migrate/20150407070804_states_to_string.rb
flyboy-0.0.6 db/migrate/20150407070804_states_to_string.rb
flyboy-0.0.5 db/migrate/20150407070804_states_to_string.rb
flyboy-0.0.4 db/migrate/20150407070804_states_to_string.rb