Project

General

Profile

Download (563 Bytes) Statistics
| Branch: | Tag: | Revision:
# arts uses centimeter and not milimeter, but mm is better for storage
class Admin::ArtworkSizesController < Admin::AdminController
simple_rest_support

private

def prepared_params
p = resource_params.dup
p[:height] = cm_to_mm(p[:height]) if p[:height]
p[:width] = cm_to_mm(p[:width]) if p[:width]
return p
end

def prepared_object(orig_artwork_size)
artwork_size = orig_artwork_size.dup
artwork_size.height = mm_to_cm(artwork_size.height)
artwork_size.width = mm_to_cm(artwork_size.width)
return artwork_size
end
end
(6-6/10)