mongoid_money_field 5.2.1 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/Gemfile +2 -1
- data/Gemfile.lock +54 -49
- data/README.rdoc +1 -1
- data/lib/mongoid_money_field/type.rb +6 -7
- data/lib/mongoid_money_field/version.rb +1 -1
- data/mongoid_money_field.gemspec +2 -2
- data/spec/money_spec.rb +1 -1
- data/spec/ruby_money_spec.rb +7 -4
- data/spec/support/priceable.rb +2 -2
- metadata +7 -9
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ae17f88c73cea010f9ff5ce2c872965186afe45
|
4
|
+
data.tar.gz: 3fe8cf5040460ecc563e720900acf45ce76344f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff0fc67c021bdc35877ef9501937b4a68b135bc9ee87501c6c6fd6a2472fdf9e48801154e09702b1e308ed1d279698f03826ccb7590bd2c7a35a4b5794f6d5cb
|
7
|
+
data.tar.gz: 4d2f5f4f813fb6f58c3039b558c23b1279a4e0e3d991a16a49136e3ad94240a1187f914d6932f996ec60f689b5d820759223b4812ddf56e9fafd8f070a3f46ed
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,82 +1,87 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/DatabaseCleaner/database_cleaner.git
|
3
|
+
revision: 5b15b4cd90d969b4da9bb0f1ef4010bddffc5cc6
|
4
|
+
specs:
|
5
|
+
database_cleaner (1.4.0)
|
6
|
+
|
1
7
|
PATH
|
2
8
|
remote: .
|
3
9
|
specs:
|
4
|
-
mongoid_money_field (
|
10
|
+
mongoid_money_field (6.0.0)
|
5
11
|
monetize
|
6
|
-
money (~> 6.
|
7
|
-
mongoid (>=
|
12
|
+
money (~> 6.5.0)
|
13
|
+
mongoid (>= 4.0.0)
|
8
14
|
|
9
15
|
GEM
|
10
16
|
remote: https://rubygems.org/
|
11
17
|
specs:
|
12
|
-
activemodel (4.0
|
13
|
-
activesupport (= 4.0
|
14
|
-
builder (~> 3.1
|
15
|
-
activesupport (4.0
|
16
|
-
i18n (~> 0.
|
17
|
-
|
18
|
-
|
19
|
-
thread_safe (~> 0.
|
20
|
-
tzinfo (~>
|
18
|
+
activemodel (4.2.0)
|
19
|
+
activesupport (= 4.2.0)
|
20
|
+
builder (~> 3.1)
|
21
|
+
activesupport (4.2.0)
|
22
|
+
i18n (~> 0.7)
|
23
|
+
json (~> 1.7, >= 1.7.7)
|
24
|
+
minitest (~> 5.1)
|
25
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
26
|
+
tzinfo (~> 1.1)
|
21
27
|
bson (2.3.0)
|
22
|
-
builder (3.
|
23
|
-
connection_pool (2.
|
24
|
-
database_cleaner (1.3.0)
|
28
|
+
builder (3.2.2)
|
29
|
+
connection_pool (2.1.0)
|
25
30
|
diff-lcs (1.2.5)
|
26
|
-
docile (1.1.
|
27
|
-
i18n (0.
|
28
|
-
json (1.8.
|
29
|
-
minitest (
|
30
|
-
monetize (
|
31
|
-
money (~> 6.
|
32
|
-
money (6.
|
33
|
-
i18n (
|
34
|
-
mongoid (4.0.0
|
35
|
-
activemodel (~> 4.0
|
36
|
-
moped (~> 2.0.0
|
31
|
+
docile (1.1.5)
|
32
|
+
i18n (0.7.0)
|
33
|
+
json (1.8.2)
|
34
|
+
minitest (5.5.1)
|
35
|
+
monetize (1.1.0)
|
36
|
+
money (~> 6.5.0)
|
37
|
+
money (6.5.0)
|
38
|
+
i18n (>= 0.6.4, <= 0.7.0)
|
39
|
+
mongoid (4.0.0)
|
40
|
+
activemodel (~> 4.0)
|
41
|
+
moped (~> 2.0.0)
|
37
42
|
origin (~> 2.1)
|
38
43
|
tzinfo (>= 0.3.37)
|
39
|
-
mongoid-rspec (
|
40
|
-
mongoid (
|
44
|
+
mongoid-rspec (2.0.0)
|
45
|
+
mongoid (~> 4.0.0)
|
41
46
|
rake
|
42
|
-
rspec (
|
43
|
-
moped (2.0.
|
47
|
+
rspec (~> 3.1)
|
48
|
+
moped (2.0.3)
|
44
49
|
bson (~> 2.2)
|
45
50
|
connection_pool (~> 2.0)
|
46
51
|
optionable (~> 0.2.0)
|
47
52
|
multi_json (1.10.1)
|
48
53
|
optionable (0.2.0)
|
49
54
|
origin (2.1.1)
|
50
|
-
rake (10.
|
51
|
-
rdoc (4.
|
52
|
-
|
53
|
-
|
54
|
-
rspec-
|
55
|
-
rspec-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
rspec-expectations (3.0.0)
|
55
|
+
rake (10.4.2)
|
56
|
+
rdoc (4.2.0)
|
57
|
+
rspec (3.1.0)
|
58
|
+
rspec-core (~> 3.1.0)
|
59
|
+
rspec-expectations (~> 3.1.0)
|
60
|
+
rspec-mocks (~> 3.1.0)
|
61
|
+
rspec-core (3.1.7)
|
62
|
+
rspec-support (~> 3.1.0)
|
63
|
+
rspec-expectations (3.1.2)
|
60
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.
|
62
|
-
rspec-mocks (3.
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-support (3.
|
65
|
-
simplecov (0.
|
65
|
+
rspec-support (~> 3.1.0)
|
66
|
+
rspec-mocks (3.1.3)
|
67
|
+
rspec-support (~> 3.1.0)
|
68
|
+
rspec-support (3.1.2)
|
69
|
+
simplecov (0.9.1)
|
66
70
|
docile (~> 1.1.0)
|
67
|
-
multi_json
|
71
|
+
multi_json (~> 1.0)
|
68
72
|
simplecov-html (~> 0.8.0)
|
69
73
|
simplecov-html (0.8.0)
|
70
74
|
thread_safe (0.3.4)
|
71
|
-
tzinfo (
|
75
|
+
tzinfo (1.2.2)
|
76
|
+
thread_safe (~> 0.1)
|
72
77
|
|
73
78
|
PLATFORMS
|
74
79
|
ruby
|
75
80
|
|
76
81
|
DEPENDENCIES
|
77
82
|
bundler
|
78
|
-
database_cleaner
|
79
|
-
mongoid (~> 4.0.0
|
83
|
+
database_cleaner!
|
84
|
+
mongoid (~> 4.0.0)
|
80
85
|
mongoid-rspec
|
81
86
|
mongoid_money_field!
|
82
87
|
rake
|
data/README.rdoc
CHANGED
@@ -14,16 +14,15 @@ class MoneyType
|
|
14
14
|
# this custom class from it.
|
15
15
|
def demongoize(object)
|
16
16
|
if object.is_a?(Hash)
|
17
|
-
object
|
18
|
-
|
19
|
-
if object.has_key?(:cents)
|
17
|
+
object.stringify_keys!
|
18
|
+
if object.has_key?('cents')
|
20
19
|
if @options[:fixed_currency]
|
21
|
-
::Money.new(object[
|
20
|
+
::Money.new(object['cents'], @options[:fixed_currency])
|
22
21
|
else
|
23
|
-
if object.has_key?(
|
24
|
-
::Money.new(object[
|
22
|
+
if object.has_key?('currency_iso')
|
23
|
+
::Money.new(object['cents'], object['currency_iso'])
|
25
24
|
else
|
26
|
-
::Money.new(object[
|
25
|
+
::Money.new(object['cents'], @options[:default_currency])
|
27
26
|
end
|
28
27
|
end
|
29
28
|
else
|
data/mongoid_money_field.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "mongoid", ">=
|
22
|
-
spec.add_runtime_dependency "money", "~> 6.
|
21
|
+
spec.add_runtime_dependency "mongoid", ">= 4.0.0"
|
22
|
+
spec.add_runtime_dependency "money", "~> 6.5.0"
|
23
23
|
spec.add_runtime_dependency "monetize"
|
24
24
|
|
25
25
|
spec.add_development_dependency "rake"
|
data/spec/money_spec.rb
CHANGED
data/spec/ruby_money_spec.rb
CHANGED
@@ -41,9 +41,12 @@ describe Money do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context "demongoize" do
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
before :each do
|
45
|
+
priceable.save
|
46
|
+
@subj = Priceable.first.price
|
47
|
+
end
|
48
|
+
it { expect(@subj).to be_an_instance_of(Money) }
|
49
|
+
it { expect(@subj).to eq(Money.new(100, 'EUR')) }
|
47
50
|
it "returns nil if a nil value was stored" do
|
48
51
|
nil_priceable = Priceable.create(:price => nil)
|
49
52
|
expect(nil_priceable.price).to be_nil
|
@@ -59,4 +62,4 @@ describe Money do
|
|
59
62
|
expect(Priceable.where(:price => Money.new(100, 'EUR')).first).to eq(priceable)
|
60
63
|
end
|
61
64
|
end
|
62
|
-
end
|
65
|
+
end
|
data/spec/support/priceable.rb
CHANGED
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:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Tv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: money
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.
|
33
|
+
version: 6.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.
|
40
|
+
version: 6.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: monetize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,8 +160,6 @@ files:
|
|
160
160
|
- ".document"
|
161
161
|
- ".gitignore"
|
162
162
|
- ".rspec"
|
163
|
-
- ".ruby-gemset"
|
164
|
-
- ".ruby-version"
|
165
163
|
- ".travis.yml"
|
166
164
|
- Gemfile
|
167
165
|
- Gemfile.lock
|
@@ -215,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
213
|
version: '0'
|
216
214
|
requirements: []
|
217
215
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
216
|
+
rubygems_version: 2.4.5
|
219
217
|
signing_key:
|
220
218
|
specification_version: 4
|
221
219
|
summary: Use RubyMoney with mongoid
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
moneyfield
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.2
|