nofxx-money 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -2
- data/lib/money/acts_as_money.rb +1 -1
- data/lib/money.rb +1 -1
- data/money.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
|
@@ -90,7 +90,7 @@ app/models/product.rb
|
|
|
90
90
|
validate :cents_not_zero
|
|
91
91
|
|
|
92
92
|
def cents_not_zero
|
|
93
|
-
errors.add("
|
|
93
|
+
errors.add("price_cents", "cannot be zero or less") unless cents > 0
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
validates_presence_of :sku, :currency
|
|
@@ -100,7 +100,7 @@ app/models/product.rb
|
|
|
100
100
|
migration:
|
|
101
101
|
|
|
102
102
|
create_table :products do |t|
|
|
103
|
-
t.integer :
|
|
103
|
+
t.integer :price_cents
|
|
104
104
|
t.string :price_currency
|
|
105
105
|
end
|
|
106
106
|
|
data/lib/money/acts_as_money.rb
CHANGED
|
@@ -26,7 +26,7 @@ module ActsAsMoney #:nodoc:
|
|
|
26
26
|
:allow_nil => false }.update(attributes.extract_options!)
|
|
27
27
|
|
|
28
28
|
attributes.each do |attr|
|
|
29
|
-
mapping = [[config[:cents] || "#{attr}
|
|
29
|
+
mapping = [[config[:cents] || "#{attr}_cents", 'cents']]
|
|
30
30
|
mapping << [config[:currency] || "#{attr}_currency", 'currency'] if config[:with_currency]
|
|
31
31
|
|
|
32
32
|
composed_of attr, :class_name => 'Money',:allow_nil => config[:allow_nil],
|
data/lib/money.rb
CHANGED
data/money.gemspec
CHANGED