Project

General

Profile

Download (563 Bytes) Statistics
| Branch: | Tag: | Revision:

root / app / controllers / admin / artwork_sizes_controller.rb @ 70e65017

1 b689e231 Marc Dequènes (Duck)
# arts uses centimeter and not milimeter, but mm is better for storage
2
class Admin::ArtworkSizesController < Admin::AdminController
3
  simple_rest_support
4
5
  private
6
7
  def prepared_params
8
    p = resource_params.dup
9
    p[:height] = cm_to_mm(p[:height]) if p[:height]
10
    p[:width] = cm_to_mm(p[:width]) if p[:width]
11
    return p
12
  end
13
14
  def prepared_object(orig_artwork_size)
15
    artwork_size = orig_artwork_size.dup
16
    artwork_size.height = mm_to_cm(artwork_size.height)
17
    artwork_size.width = mm_to_cm(artwork_size.width)
18
    return artwork_size
19
  end
20
end