lib/money/acts_as_money.rb in nofxx-money-2.2.1 vs lib/money/acts_as_money.rb in nofxx-money-2.2.2
- old
+ new
@@ -24,10 +24,10 @@
def has_money(*attributes)
config = {:with_currency => true, :converter => lambda { |m| m.to_money },
:allow_nil => false }.update(attributes.extract_options!)
attributes.each do |attr|
- mapping = [[config[:cents] || "#{attr}_in_cents", 'cents']]
+ mapping = [[config[:cents] || "#{attr}_cents", 'cents']]
mapping << [config[:currency] || "#{attr}_currency", 'currency'] if config[:with_currency]
composed_of attr, :class_name => 'Money',:allow_nil => config[:allow_nil],
:mapping => mapping, :converter => config[:converter]
end