Browse files

pick instance currency from currency_column[:default_name]

  • Loading branch information...
1 parent 2156874 commit 1562b507884c3d5e08290225f159e4ff314e5cac Paolo Dona committed Jul 4, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/money-rails/active_record/monetizable.rb
View
6 lib/money-rails/active_record/monetizable.rb
@@ -21,9 +21,9 @@ def monetize(field, *args)
":with_currency or :with_model_currency")
end
- # Optional accessor to be run on an instance to detect currency
+ # Optional accessor to be run on an instance to detect currency
instance_currency_name = options[:with_model_currency] ||
- options[:model_currency] || "currency"
+ options[:model_currency] || MoneyRails::Configuration.currency_column[:column_name] || "currency"
instance_currency_name = instance_currency_name.to_s
# This attribute allows per column currency values
@@ -63,7 +63,7 @@ def monetized_attributes
#
# All the options which are available for Rails numericality
# validation, are also available for both types.
- # E.g.
+ # E.g.
# monetize :price_in_a_range_cents, :allow_nil => true,
# :subunit_numericality => {
# :greater_than_or_equal_to => 0,

0 comments on commit 1562b50

Please sign in to comment.