Sha256: d92f5cc8b489620bcea9768725477205b76b043742891d9f016ad3eee1b77222

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

class CopyLatLongPropsToLatLongColumns < ActiveRecord::Migration[4.2]
  def up
    G5Updatable::Location.all.each do |location|
      location.latitude = location.properties['latitude']
      location.longitude = location.properties['longitude']
      location.save
    end
  end

  def down
    G5Updatable::Location.all.each do |location|
      location.properties['latitude'] = location.latitude
      location.proper['longitude'] = location.longitude
      location.latitude = nil
      location.longitude = nil
      location.save
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
g5_updatable-1.0.2.pre.1 db/migrate/20151103050229_copy_lat_long_props_to_lat_long_columns.rb