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 CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('fantastic_currency', '0.1.1') do |p|
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 }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fantastic_currency}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Rob Mason"]
@@ -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
- if self[field_name]
122
- currency = FantasticCurrency::Config.get_currency(self[:currency])
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fantastic_currency
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Mason