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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fa9328b26147c73afdde5adfe03a4a14bf54d05f4a704e89484d472648ea438
4
- data.tar.gz: f7140ca4647c293bb26b0a8ef2485ba9a60e7b9f43676bb9a9606230eebc1beb
3
+ metadata.gz: 8ae43f2d2161532a660a5d3e9cfb2b4622ee845c6d2fd48b67d0483104228d3e
4
+ data.tar.gz: 96472c8e8ca9b1834cfa3d954261bc6c2d36fd508559c9924932d2a65e44f71a
5
5
  SHA512:
6
- metadata.gz: acd6a7587006c8ca7e3b00363c32e04ccc2ed5a084212b73a64c80d05f349706c8b0b518c49d95cdf75541120ab855c70851d0aba1d204827aa19bd154e1e7ca
7
- data.tar.gz: aff132aed03d53195c5c0b32308df394837ea72d8a2633350da8f08625c288dd2aefc2a3229559affdd960557d2a30cf3ee5c2b136554897f0a3cf36032f4fde
6
+ metadata.gz: 6af1c9e78278977317d8a4cc49e633f8149cedc94fc2680d4aad6ba985e1d8e19cd57c203005d45afcc7b1930d9c83ddd3ce8f3ae60ce0527fa5bccc2e756bc0
7
+ data.tar.gz: 5c9a1573f1abd2e0f4c534975cf390882d2ea949117e53cc50ba3837b9706e1b80c6878e7c7ab390b7c14c1fbcfcaba2466a57dcc2b923fdf1a418943815a234
data/.travis.yml CHANGED
@@ -3,5 +3,7 @@ language: ruby
3
3
  services: mongodb
4
4
 
5
5
  rvm:
6
- - 2.2.2
6
+ - 2.4
7
+ - 2.5
8
+ - 2.6
7
9
 
data/Gemfile.lock CHANGED
@@ -1,77 +1,83 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongoid_money_field (7.0.1)
4
+ mongoid_money_field (7.3.0)
5
5
  monetize
6
- money (~> 6.13.2)
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 (5.2.2)
13
- activesupport (= 5.2.2)
14
- activesupport (5.2.2)
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 (>= 0.7, < 2)
17
- minitest (~> 5.1)
18
- tzinfo (~> 1.1)
19
- bson (4.4.2)
20
- concurrent-ruby (1.1.4)
21
- database_cleaner (1.7.0)
22
- diff-lcs (1.3)
23
- docile (1.3.1)
24
- i18n (1.5.3)
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
- json (2.1.0)
27
- minitest (5.11.3)
28
- monetize (1.9.0)
29
+ minitest (5.25.0)
30
+ monetize (1.13.0)
29
31
  money (~> 6.12)
30
- money (6.13.2)
32
+ money (6.19.0)
31
33
  i18n (>= 0.6.4, <= 2)
32
- mongo (2.7.0)
33
- bson (>= 4.4.2, < 5.0.0)
34
- mongoid (7.0.2)
35
- activemodel (>= 5.1, < 6.0.0)
36
- mongo (>= 2.5.1, < 3.0.0)
37
- mongoid-compatibility (0.5.1)
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.1)
41
- activesupport (>= 3.0.0)
42
- mongoid (>= 3.1)
43
+ mongoid-rspec (4.2.0)
44
+ mongoid (>= 3.0, < 10.0)
43
45
  mongoid-compatibility (>= 0.5.1)
44
- rspec (~> 3.3)
45
- rake (12.3.2)
46
- rdoc (6.1.1)
47
- rspec (3.8.0)
48
- rspec-core (~> 3.8.0)
49
- rspec-expectations (~> 3.8.0)
50
- rspec-mocks (~> 3.8.0)
51
- rspec-core (3.8.0)
52
- rspec-support (~> 3.8.0)
53
- rspec-expectations (3.8.2)
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.8.0)
56
- rspec-mocks (3.8.0)
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.8.0)
59
- rspec-support (3.8.0)
60
- simplecov (0.16.1)
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
- json (>= 1.8, < 3)
63
- simplecov-html (~> 0.10.0)
64
- simplecov-html (0.10.2)
65
- thread_safe (0.3.6)
66
- tzinfo (1.2.5)
67
- thread_safe (~> 0.1)
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
- ruby
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
- 1.17.2
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
@@ -1,3 +1,3 @@
1
1
  module MongoidMoneyField
2
- VERSION = "7.0.1"
2
+ VERSION = "7.3.0"
3
3
  end
@@ -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.13.2"
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 = :truncation
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
@@ -3,4 +3,8 @@ test:
3
3
  default:
4
4
  database: mongoid_money_field
5
5
  hosts:
6
- - localhost:27017
6
+ - localhost:27019
7
+ options:
8
+ user: 'admin'
9
+ password: 'rs123456'
10
+ auth_source: admin
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.1
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: 2019-02-05 00:00:00.000000000 Z
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.13.2
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.13.2
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.0.2
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: