mongoid_money_field 7.0.1 → 7.3.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 +3 -1
- data/Gemfile.lock +57 -51
- data/README.rdoc +0 -1
- data/lib/mongoid_money_field/field.rb +2 -0
- data/lib/mongoid_money_field/type.rb +3 -1
- data/lib/mongoid_money_field/version.rb +1 -1
- data/mongoid_money_field.gemspec +2 -2
- data/spec/spec_helper.rb +4 -3
- data/spec/support/mongoid.yml +5 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ae43f2d2161532a660a5d3e9cfb2b4622ee845c6d2fd48b67d0483104228d3e
|
4
|
+
data.tar.gz: 96472c8e8ca9b1834cfa3d954261bc6c2d36fd508559c9924932d2a65e44f71a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6af1c9e78278977317d8a4cc49e633f8149cedc94fc2680d4aad6ba985e1d8e19cd57c203005d45afcc7b1930d9c83ddd3ce8f3ae60ce0527fa5bccc2e756bc0
|
7
|
+
data.tar.gz: 5c9a1573f1abd2e0f4c534975cf390882d2ea949117e53cc50ba3837b9706e1b80c6878e7c7ab390b7c14c1fbcfcaba2466a57dcc2b923fdf1a418943815a234
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,77 +1,83 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mongoid_money_field (7.0
|
4
|
+
mongoid_money_field (7.3.0)
|
5
5
|
monetize
|
6
|
-
money (~> 6.
|
6
|
+
money (~> 6.19)
|
7
7
|
mongoid (~> 7.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (
|
13
|
-
activesupport (=
|
14
|
-
activesupport (
|
12
|
+
activemodel (7.0.8.4)
|
13
|
+
activesupport (= 7.0.8.4)
|
14
|
+
activesupport (7.0.8.4)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
-
i18n (>=
|
17
|
-
minitest (
|
18
|
-
tzinfo (~>
|
19
|
-
bson (
|
20
|
-
concurrent-ruby (1.
|
21
|
-
database_cleaner (
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
19
|
+
bson (5.0.1)
|
20
|
+
concurrent-ruby (1.3.4)
|
21
|
+
database_cleaner-core (2.0.1)
|
22
|
+
database_cleaner-mongoid (2.0.1)
|
23
|
+
database_cleaner-core (~> 2.0.0)
|
24
|
+
mongoid
|
25
|
+
diff-lcs (1.5.1)
|
26
|
+
docile (1.4.1)
|
27
|
+
i18n (1.14.5)
|
25
28
|
concurrent-ruby (~> 1.0)
|
26
|
-
|
27
|
-
|
28
|
-
monetize (1.9.0)
|
29
|
+
minitest (5.25.0)
|
30
|
+
monetize (1.13.0)
|
29
31
|
money (~> 6.12)
|
30
|
-
money (6.
|
32
|
+
money (6.19.0)
|
31
33
|
i18n (>= 0.6.4, <= 2)
|
32
|
-
mongo (2.
|
33
|
-
bson (>= 4.
|
34
|
-
mongoid (7.
|
35
|
-
activemodel (>= 5.1, <
|
36
|
-
mongo (>= 2.5
|
37
|
-
|
34
|
+
mongo (2.20.1)
|
35
|
+
bson (>= 4.14.1, < 6.0.0)
|
36
|
+
mongoid (7.5.4)
|
37
|
+
activemodel (>= 5.1, < 7.1, != 7.0.0)
|
38
|
+
mongo (>= 2.10.5, < 3.0.0)
|
39
|
+
ruby2_keywords (~> 0.0.5)
|
40
|
+
mongoid-compatibility (1.0.0)
|
38
41
|
activesupport
|
39
42
|
mongoid (>= 2.0)
|
40
|
-
mongoid-rspec (4.0
|
41
|
-
|
42
|
-
mongoid (>= 3.1)
|
43
|
+
mongoid-rspec (4.2.0)
|
44
|
+
mongoid (>= 3.0, < 10.0)
|
43
45
|
mongoid-compatibility (>= 0.5.1)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
rspec-
|
51
|
-
|
52
|
-
rspec-
|
53
|
-
rspec-
|
46
|
+
psych (5.1.2)
|
47
|
+
stringio
|
48
|
+
rake (13.2.1)
|
49
|
+
rdoc (6.7.0)
|
50
|
+
psych (>= 4.0.0)
|
51
|
+
rspec (3.13.0)
|
52
|
+
rspec-core (~> 3.13.0)
|
53
|
+
rspec-expectations (~> 3.13.0)
|
54
|
+
rspec-mocks (~> 3.13.0)
|
55
|
+
rspec-core (3.13.0)
|
56
|
+
rspec-support (~> 3.13.0)
|
57
|
+
rspec-expectations (3.13.1)
|
54
58
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
-
rspec-support (~> 3.
|
56
|
-
rspec-mocks (3.
|
59
|
+
rspec-support (~> 3.13.0)
|
60
|
+
rspec-mocks (3.13.1)
|
57
61
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
|
-
rspec-support (~> 3.
|
59
|
-
rspec-support (3.
|
60
|
-
|
62
|
+
rspec-support (~> 3.13.0)
|
63
|
+
rspec-support (3.13.1)
|
64
|
+
ruby2_keywords (0.0.5)
|
65
|
+
simplecov (0.22.0)
|
61
66
|
docile (~> 1.1)
|
62
|
-
|
63
|
-
|
64
|
-
simplecov-html (0.
|
65
|
-
|
66
|
-
|
67
|
-
|
67
|
+
simplecov-html (~> 0.11)
|
68
|
+
simplecov_json_formatter (~> 0.1)
|
69
|
+
simplecov-html (0.12.3)
|
70
|
+
simplecov_json_formatter (0.1.4)
|
71
|
+
stringio (3.1.1)
|
72
|
+
tzinfo (2.0.6)
|
73
|
+
concurrent-ruby (~> 1.0)
|
68
74
|
|
69
75
|
PLATFORMS
|
70
|
-
|
76
|
+
x86_64-linux
|
71
77
|
|
72
78
|
DEPENDENCIES
|
73
79
|
bundler
|
74
|
-
database_cleaner
|
80
|
+
database_cleaner-mongoid
|
75
81
|
mongoid-rspec
|
76
82
|
mongoid_money_field!
|
77
83
|
rake
|
@@ -80,4 +86,4 @@ DEPENDENCIES
|
|
80
86
|
simplecov
|
81
87
|
|
82
88
|
BUNDLED WITH
|
83
|
-
|
89
|
+
2.4.10
|
data/README.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
== mongoid money field
|
2
2
|
|
3
3
|
{<img src="https://secure.travis-ci.org/glebtv/mongoid_money_field.png" alt="Build Status" />}[http://travis-ci.org/glebtv/mongoid_money_field]
|
4
|
-
{<img src="https://gemnasium.com/glebtv/mongoid_money_field.png" alt="Dependency Status" />}[https://gemnasium.com/glebtv/mongoid_money_field]
|
5
4
|
|
6
5
|
This is a super simple gem to use RubyMoney money type columns with mongoid
|
7
6
|
|
@@ -27,6 +27,8 @@ class Money
|
|
27
27
|
# stored in the database.
|
28
28
|
def mongoize(object)
|
29
29
|
case
|
30
|
+
when object.is_a?(BSON::Document) then
|
31
|
+
::Money.new(object[:cents], object[:currency_iso]).mongoize
|
30
32
|
when object.is_a?(Money) then object.mongoize
|
31
33
|
when object.is_a?(Hash) then
|
32
34
|
object.symbolize_keys! if object.respond_to?(:symbolize_keys!)
|
@@ -48,6 +48,8 @@ class MoneyType
|
|
48
48
|
end
|
49
49
|
|
50
50
|
ret = case
|
51
|
+
when object.is_a?(BSON::Document) then
|
52
|
+
::Money.new(object[:cents], object[:currency_iso]).mongoize
|
51
53
|
when object.is_a?(Money) then object.mongoize
|
52
54
|
when object.is_a?(Hash) then
|
53
55
|
object.symbolize_keys! if object.respond_to?(:symbolize_keys!)
|
@@ -66,7 +68,7 @@ class MoneyType
|
|
66
68
|
unless @options[:default_currency].nil?
|
67
69
|
Money.default_currency = old_default
|
68
70
|
end
|
69
|
-
|
71
|
+
|
70
72
|
if !ret.nil? && @options[:fixed_currency]
|
71
73
|
ret[:currency_iso] = @options[:fixed_currency]
|
72
74
|
end
|
data/mongoid_money_field.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "mongoid", "~> 7.0"
|
22
|
-
spec.add_runtime_dependency "money", "~> 6.
|
22
|
+
spec.add_runtime_dependency "money", "~> 6.19"
|
23
23
|
spec.add_runtime_dependency "monetize"
|
24
24
|
|
25
25
|
spec.add_development_dependency "rake"
|
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "rspec"
|
28
28
|
spec.add_development_dependency "rdoc"
|
29
29
|
spec.add_development_dependency "simplecov"
|
30
|
-
spec.add_development_dependency "database_cleaner"
|
30
|
+
spec.add_development_dependency "database_cleaner-mongoid"
|
31
31
|
spec.add_development_dependency "mongoid-rspec"
|
32
32
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,7 +9,7 @@ SimpleCov.start
|
|
9
9
|
|
10
10
|
require 'bundler/setup'
|
11
11
|
require 'mongoid'
|
12
|
-
require 'database_cleaner'
|
12
|
+
require 'database_cleaner-mongoid'
|
13
13
|
require 'mongoid-rspec'
|
14
14
|
|
15
15
|
require 'mongoid_money_field'
|
@@ -38,11 +38,12 @@ end
|
|
38
38
|
|
39
39
|
RSpec.configure do |config|
|
40
40
|
config.before :suite do
|
41
|
-
DatabaseCleaner.strategy = :
|
41
|
+
DatabaseCleaner[:mongoid].strategy = [:deletion]
|
42
|
+
#DatabaseCleaner.strategy = :truncation
|
42
43
|
end
|
43
44
|
config.after :each do
|
44
45
|
DatabaseCleaner.clean
|
45
46
|
end
|
46
47
|
config.include Mongoid::Matchers
|
47
48
|
config.mock_with :rspec
|
48
|
-
end
|
49
|
+
end
|
data/spec/support/mongoid.yml
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: 7.0
|
4
|
+
version: 7.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Tv
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.
|
33
|
+
version: '6.19'
|
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.19'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: monetize
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: database_cleaner
|
126
|
+
name: database_cleaner-mongoid
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -195,7 +195,7 @@ homepage: http://github.com/glebtv/mongoid_money_field
|
|
195
195
|
licenses:
|
196
196
|
- MIT
|
197
197
|
metadata: {}
|
198
|
-
post_install_message:
|
198
|
+
post_install_message:
|
199
199
|
rdoc_options: []
|
200
200
|
require_paths:
|
201
201
|
- lib
|
@@ -210,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
- !ruby/object:Gem::Version
|
211
211
|
version: '0'
|
212
212
|
requirements: []
|
213
|
-
rubygems_version: 3.
|
214
|
-
signing_key:
|
213
|
+
rubygems_version: 3.4.10
|
214
|
+
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Use RubyMoney with mongoid
|
217
217
|
test_files:
|