Changed Unit.type -> .group
Added Unit validations. Added default Units.
This commit is contained in:
@@ -4,7 +4,20 @@ class CreateUnits < ActiveRecord::Migration
|
||||
t.references :project
|
||||
t.string :name
|
||||
t.string :shortname
|
||||
t.integer :type
|
||||
t.integer :group
|
||||
end
|
||||
|
||||
reversible do |dir|
|
||||
dir.up do
|
||||
Unit.create project: nil, shortname: "", name: "count", group: :number
|
||||
Unit.create project: nil, shortname: "%", name: "percent", group: :share
|
||||
Unit.create project: nil, shortname: "g", name: "gram", group: :mass
|
||||
Unit.create project: nil, shortname: "kg", name: "kilogram", group: :mass
|
||||
end
|
||||
|
||||
dir.down do
|
||||
Unit.delete_all
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user