title: Active admin and money
body: <p>I am using active admin with the <a href="https://github.com/RubyMoney/money" rel="nofollow">money - https://github.com/RubyMoney/money</a> gem. I have some attributes handled by the money gem.</p>
  
  <p>The money gem stores values in cents. When i create an entry with active admin, the correct value is created in DB (5000 for 50.00).</p>
  
  <p>However when i edit an entry, the value is multiplied by 100, meaning that AA display 5000 for an original input of 50.00. If i edit anything with a money attribute, it will multiply by 100. At creation, the value goes through money logic, but at edition, somehow active admin skip that part displaying cents instead of the final monetary value.
  Is there a way to use the money gem with active admin?</p>
  
  <p>example :</p>
  
  <pre><code>form :html =&gt; { :enctype =&gt; "multipart/form-data"} do |f|
    f.inputs "Products" do
      ......
      f.has_many :pricings do |p|
        p.input :price
        p.input :_destroy, :as =&gt; :boolean,:label=&gt;"Effacer"
      end
    f.actions :publish
  end
  </code></pre>
  
  <p>Model :</p>
  
  <pre><code># encoding: utf-8 
  class Pricing &lt; ActiveRecord::Base
  belongs_to :priceable, :polymorphic =&gt; true
  attr_accessible :price
  composed_of :price,
      :class_name =&gt; "Money",
      :mapping =&gt; [%w(price cents), %w(currency currency_as_string)],
      :constructor =&gt; Proc.new { |cents, currency| Money.new(cents || 0, currency || Money.default_currency) },
      :converter =&gt; Proc.new { |value| value.respond_to?(:to_money) ? value.to_money : raise(ArgumentError, "Can't convert #{value.class} to Money") }
  end
  </code></pre>