fantastic_currency 0.1.1 → 0.1.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/Rakefile +2 -2
- data/fantastic_currency.gemspec +1 -1
- data/lib/fantastic_currency.rb +2 -4
- metadata +1 -1
data/Rakefile
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
require 'rake'
|
|
3
3
|
require 'echoe'
|
|
4
4
|
|
|
5
|
-
Echoe.new('fantastic_currency', '0.1.
|
|
5
|
+
Echoe.new('fantastic_currency', '0.1.2') do |p|
|
|
6
6
|
p.description = "Manage currencies with Active Record"
|
|
7
7
|
p.url = "http://github.com/iamcalledrob/FantasticCurrency"
|
|
8
8
|
p.author = "Rob Mason"
|
|
@@ -11,4 +11,4 @@ Echoe.new('fantastic_currency', '0.1.1') do |p|
|
|
|
11
11
|
p.development_dependencies = []
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
data/fantastic_currency.gemspec
CHANGED
data/lib/fantastic_currency.rb
CHANGED
|
@@ -118,10 +118,8 @@ module FantasticCurrency
|
|
|
118
118
|
define_method "#{field_name.to_s}=" do |value|
|
|
119
119
|
raise "Money doesn't float!" if value.class.name == "Float"
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
self[field_name] = (BigDecimal.new(value.to_s) * (10**currency[:precision])).to_i
|
|
124
|
-
end
|
|
121
|
+
currency = FantasticCurrency::Config.get_currency(self[:currency])
|
|
122
|
+
self[field_name] = (BigDecimal.new(value.to_s) * (10**currency[:precision])).to_i
|
|
125
123
|
end
|
|
126
124
|
|
|
127
125
|
end
|