mongoid_money_field 5.0.2 → 5.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mongoid_money_field/type.rb +1 -1
- data/lib/mongoid_money_field/version.rb +1 -1
- data/spec/money_spec.rb +7 -0
- data/spec/support/dummy_money_with_fixed_currency.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3815815264a71bafd70ca2fa85064c484876c9e0
|
4
|
+
data.tar.gz: 13ab44c3476d3314458e8caf386d8c1f387f2417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89193856921d73b35c0e1e394334f8fd74349de6428fec92f66cf0ea4de277fc9b0802dc857403206a6ea68ac53906f36713a5849cd0f3ab27043f324e83bf8e
|
7
|
+
data.tar.gz: 17f6f913436daae2f3df6068dcd51b41f72695bc9eaa7f08ea945c8c5ac88bdc51d6623b62a95e964c183ea8de00272a79df3adfa095a9fc70c065c7f46d3635
|
data/Gemfile.lock
CHANGED
data/spec/money_spec.rb
CHANGED
@@ -256,6 +256,13 @@ describe Mongoid::MoneyField do
|
|
256
256
|
dummy.price.should eq Money.parse('5 GBP')
|
257
257
|
end
|
258
258
|
|
259
|
+
it 'works for other field' do
|
260
|
+
DummyMoneyWithFixedCurrency.create!(old_price: '5$', price: '')
|
261
|
+
dummy = DummyMoneyWithFixedCurrency.first
|
262
|
+
dummy.price.should be_nil
|
263
|
+
dummy.old_price.cents.should eq 500
|
264
|
+
end
|
265
|
+
|
259
266
|
it 'should have correct currency when value is set to 100 RUB' do
|
260
267
|
DummyMoneyWithFixedCurrency.create!(price: '100 RUB')
|
261
268
|
dummy = DummyMoneyWithFixedCurrency.first
|
@@ -1,10 +1,11 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
class DummyMoneyWithFixedCurrency
|
4
|
-
include Mongoid::Document
|
5
|
-
include Mongoid::MoneyField
|
6
|
-
|
7
|
-
field :description
|
8
|
-
|
9
|
-
money_field :price, fixed_currency: 'GBP'
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class DummyMoneyWithFixedCurrency
|
4
|
+
include Mongoid::Document
|
5
|
+
include Mongoid::MoneyField
|
6
|
+
|
7
|
+
field :description
|
8
|
+
|
9
|
+
money_field :price, fixed_currency: 'GBP'
|
10
|
+
money_field :old_price, fixed_currency: 'RUB'
|
10
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_money_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Tv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|