Sha256: bc5e39f3d46f6e713463afcf4b2c8c2e81cdab4441418d34b9c7c23519244137

Contents?: true

Size: 370 Bytes

Versions: 1

Compression:

Stored size: 370 Bytes

Contents

# Populates db with units of measure.
class PopulateOkeiUnits < ActiveRecord::Migration
  
  def up
    root = File.dirname File.dirname(Okei::Engine.called_from)
    seed = File.join(root, "db", "seeds", "units.json")
    Okei::Unit.delete_all
    JSON.parse(File.read seed).each { |item| Okei::Unit.create! item }
  end

  def down
    Okei::Unit.delete_all
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
okei-0.0.2 db/migrate/20141004212501_populate_okei_units.rb