Revision 4f40ad8a
Added by Marc Dequènes almost 15 years ago
- ID 4f40ad8a3f9120f7cdedcccfc20aab0174a65ed7
app/models/artwork_size.rb | ||
---|---|---|
validates_uniqueness_of :width, :scope => [:height], :message => _("is invalid, because this (height, width) couple already exist")
|
||
|
||
def human_size
|
||
"#{height} x #{width}"
|
||
"#{height} x #{width} mm"
|
||
end
|
||
end
|
db/schema.rb | ||
---|---|---|
add_index "artwork_sets", ["name"], :name => "nom_2"
|
||
|
||
create_table "artwork_sizes", :force => true do |t|
|
||
t.float "height", :null => false
|
||
t.float "width", :null => false
|
||
t.boolean "standard", :default => false, :null => false
|
||
t.integer "height", :limit => 10, :null => false
|
||
t.integer "width", :limit => 10, :null => false
|
||
t.boolean "standard", :default => false, :null => false
|
||
end
|
||
|
||
add_index "artwork_sizes", ["height", "width"], :name => "proportion", :unique => true
|
Also available in: Unified diff
[cosmetic] artwork_sizes height and width are now integers in the DB, and displayed with the corresponding unit (closes #14)