mongoid_money_field 7.1.0 → 7.3.1

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: 597285552799e8276c88c715b86b7daf8b8e1694f61f375415fce6cf71220fd5
4
- data.tar.gz: 26d0d83d2507bcd5680b331ded41785efa5e0e184a6809c1f7c83224dfc37655
3
+ metadata.gz: b5d42e0e5b76a46f273daf85b160ff381397b65464f10dcc5755ffc32dcda6cd
4
+ data.tar.gz: 58093c0fd31e48717a0bc26e075d94f35bb27fb6b1d94d1dffc6263234244322
5
5
  SHA512:
6
- metadata.gz: e398806524f7f4e4671d4ec459f5592bef96a8b43acd794fd7e2862dbacc53c8b53d6c100f9313c6a378dd7527e0eeb68b3babd63ae5809fe9aafc8fdbc24125
7
- data.tar.gz: 4267b53b42bb296fed44075f849a7af20ceda998581874d1fead3c79739cfd8f041b4156003bed20a19353545f92632da8055101fbcadefe96dd32cd8b437c8d
6
+ metadata.gz: c813bb22e338eb7d9ab013ee1580cebd783be96840f55c0214b3a34b19f37420b6cd8a6dd710005c7c4389cb0b22efb28cf4596644c3d6678c0e56203c934df9
7
+ data.tar.gz: 871c56d08a3863894300171d5b56702a0e6d226a8e49fa984797fb129e4c8dc01b88b4817e1bba8b959f01d77c0c974617c54ad918be85a660663d1060c30ded
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.1.0)
4
+ mongoid_money_field (7.3.1)
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.3)
13
- activesupport (= 5.2.3)
14
- activesupport (5.2.3)
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.5)
21
- database_cleaner (1.7.0)
22
- diff-lcs (1.3)
23
- docile (1.3.1)
24
- i18n (1.6.0)
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.2.0)
27
- minitest (5.11.3)
28
- monetize (1.9.1)
29
+ minitest (5.25.0)
30
+ monetize (1.13.0)
29
31
  money (~> 6.12)
30
- money (6.13.3)
32
+ money (6.19.0)
31
33
  i18n (>= 0.6.4, <= 2)
32
- mongo (2.8.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.3)
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
 
@@ -16,7 +16,7 @@ class Money
16
16
  # this custom class from it.
17
17
  def demongoize(object)
18
18
  if object.is_a?(Hash)
19
- object = object.symbolize_keys
19
+ object = object.symbolize_keys unless object.is_a?(BSON::Document)
20
20
  object.has_key?(:cents) ? ::Money.new(object[:cents], object[:currency_iso]) : nil
21
21
  else
22
22
  nil
@@ -29,7 +29,7 @@ class Money
29
29
  case
30
30
  when object.is_a?(Money) then object.mongoize
31
31
  when object.is_a?(Hash) then
32
- object.symbolize_keys! if object.respond_to?(:symbolize_keys!)
32
+ object.symbolize_keys! if object.respond_to?(:symbolize_keys!) && !object.is_a?(BSON::Document)
33
33
  ::Money.new(object[:cents], object[:currency_iso]).mongoize
34
34
  when object.respond_to?(:to_money) then
35
35
  object.to_money.mongoize
@@ -50,7 +50,7 @@ class MoneyType
50
50
  ret = case
51
51
  when object.is_a?(Money) then object.mongoize
52
52
  when object.is_a?(Hash) then
53
- object.symbolize_keys! if object.respond_to?(:symbolize_keys!)
53
+ object.symbolize_keys! if object.respond_to?(:symbolize_keys!) && !object.is_a?(BSON::Document)
54
54
  ::Money.new(object[:cents], object[:currency_iso]).mongoize
55
55
  when object.blank? then
56
56
  if !@options[:default].nil?
@@ -66,7 +66,7 @@ class MoneyType
66
66
  unless @options[:default_currency].nil?
67
67
  Money.default_currency = old_default
68
68
  end
69
-
69
+
70
70
  if !ret.nil? && @options[:fixed_currency]
71
71
  ret[:currency_iso] = @options[:fixed_currency]
72
72
  end
@@ -1,3 +1,3 @@
1
1
  module MongoidMoneyField
2
- VERSION = "7.1.0"
2
+ VERSION = "7.3.1"
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.1.0
4
+ version: 7.3.1
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-05-21 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.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: