priceable 0.0.5 → 0.0.6

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/lib/priceable.rb CHANGED
@@ -14,7 +14,7 @@ module Priceable
14
14
  end
15
15
  end
16
16
  define_method "#{price_field}=".to_sym do |new_price|
17
- send("#{price_field}#{suffix}=".to_sym, new_price.to_f * 100)
17
+ send("#{price_field}#{suffix}=".to_sym, (new_price.to_f * 100).round)
18
18
  end
19
19
  end
20
20
  if self._accessible_attributes?
@@ -1,3 +1,3 @@
1
1
  module Priceable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -11,6 +11,9 @@ describe Priceable do
11
11
  it "should create a setter method" do
12
12
  llama.price = 200.10
13
13
  llama.price_in_cents.should == 20010
14
+
15
+ llama.price = 285.53
16
+ llama.price_in_cents.should == 28553
14
17
  end
15
18
 
16
19
  it "should return 0.0 if nil" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: priceable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-04 00:00:00.000000000 Z
12
+ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -132,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  segments:
134
134
  - 0
135
- hash: 3339152091132292556
135
+ hash: -1792010130764451248
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements:
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  segments:
143
143
  - 0
144
- hash: 3339152091132292556
144
+ hash: -1792010130764451248
145
145
  requirements: []
146
146
  rubyforge_project:
147
147
  rubygems_version: 1.8.23