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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3a6882924fb9cba04e5d3292b92b2a96fb6389c
4
- data.tar.gz: 3d2d6209f835ffd23b534245c29f31131c1d4c48
3
+ metadata.gz: 6ae17f88c73cea010f9ff5ce2c872965186afe45
4
+ data.tar.gz: 3fe8cf5040460ecc563e720900acf45ce76344f5
5
5
  SHA512:
6
- metadata.gz: 5fbf1cae218d669386c979d2368090612fa39a60527b9c58fc561746d3076053d208c77146a326b043c55a2be0fe355da9a13b5813bedc53bcb4eec3e805c133
7
- data.tar.gz: 723bffc2d8933b028452bf4ab14476f1272cffdb95f37fc2ef6fcbb5cacd5cdfde14650d31c549e7aa8f995b79110c1019d74103252b354ecdbd4abf4b74ba96
6
+ metadata.gz: ff0fc67c021bdc35877ef9501937b4a68b135bc9ee87501c6c6fd6a2472fdf9e48801154e09702b1e308ed1d279698f03826ccb7590bd2c7a35a4b5794f6d5cb
7
+ data.tar.gz: 4d2f5f4f813fb6f58c3039b558c23b1279a4e0e3d991a16a49136e3ad94240a1187f914d6932f996ec60f689b5d820759223b4812ddf56e9fafd8f070a3f46ed
data/.travis.yml CHANGED
@@ -7,7 +7,6 @@ gemfile:
7
7
  - gemfiles/money6-mongoid4.gemfile
8
8
 
9
9
  rvm:
10
- - 1.9.3
11
- - 2.0.0
12
10
  - 2.1.0
13
- - jruby-19mode
11
+ - 2.2.0
12
+
data/Gemfile CHANGED
@@ -1,6 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in mongoid_money_field.gemspec
4
- gem "mongoid", "~> 4.0.0.beta1"
4
+ gem "mongoid", "~> 4.0.0"
5
+ gem 'database_cleaner', github: 'DatabaseCleaner/database_cleaner'
5
6
 
6
7
  gemspec
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 (5.2.1)
10
+ mongoid_money_field (6.0.0)
5
11
  monetize
6
- money (~> 6.1.0.beta1)
7
- mongoid (>= 3.0.0)
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.5)
13
- activesupport (= 4.0.5)
14
- builder (~> 3.1.0)
15
- activesupport (4.0.5)
16
- i18n (~> 0.6, >= 0.6.9)
17
- minitest (~> 4.2)
18
- multi_json (~> 1.3)
19
- thread_safe (~> 0.1)
20
- tzinfo (~> 0.3.37)
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.1.4)
23
- connection_pool (2.0.0)
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.3)
27
- i18n (0.6.9)
28
- json (1.8.1)
29
- minitest (4.7.5)
30
- monetize (0.3.0)
31
- money (~> 6.1.0.beta1)
32
- money (6.1.1)
33
- i18n (~> 0.6.4)
34
- mongoid (4.0.0.rc1)
35
- activemodel (~> 4.0.0)
36
- moped (~> 2.0.0.rc1)
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 (1.10.0)
40
- mongoid (>= 3.0.1)
44
+ mongoid-rspec (2.0.0)
45
+ mongoid (~> 4.0.0)
41
46
  rake
42
- rspec (>= 2.14)
43
- moped (2.0.0.rc1)
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.3.2)
51
- rdoc (4.1.1)
52
- json (~> 1.4)
53
- rspec (3.0.0)
54
- rspec-core (~> 3.0.0)
55
- rspec-expectations (~> 3.0.0)
56
- rspec-mocks (~> 3.0.0)
57
- rspec-core (3.0.0)
58
- rspec-support (~> 3.0.0)
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.0.0)
62
- rspec-mocks (3.0.1)
63
- rspec-support (~> 3.0.0)
64
- rspec-support (3.0.0)
65
- simplecov (0.8.2)
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 (0.3.39)
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.beta1)
83
+ database_cleaner!
84
+ mongoid (~> 4.0.0)
80
85
  mongoid-rspec
81
86
  mongoid_money_field!
82
87
  rake
data/README.rdoc CHANGED
@@ -43,7 +43,7 @@ please avoid using v2, i realized that API was stupid after commiting it.
43
43
 
44
44
  Include the gem in your Gemfile
45
45
 
46
- gem 'mongoid_money_field', '~> 5.0.0'
46
+ gem 'mongoid_money_field', '~> 5.2.1'
47
47
 
48
48
  == Usage
49
49
 
@@ -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 = object.symbolize_keys
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[:cents], @options[:fixed_currency])
20
+ ::Money.new(object['cents'], @options[:fixed_currency])
22
21
  else
23
- if object.has_key?(:currency_iso)
24
- ::Money.new(object[:cents], object[:currency_iso])
22
+ if object.has_key?('currency_iso')
23
+ ::Money.new(object['cents'], object['currency_iso'])
25
24
  else
26
- ::Money.new(object[:cents], @options[:default_currency])
25
+ ::Money.new(object['cents'], @options[:default_currency])
27
26
  end
28
27
  end
29
28
  else
@@ -1,3 +1,3 @@
1
1
  module MongoidMoneyField
2
- VERSION = "5.2.1"
2
+ VERSION = "6.0.0"
3
3
  end
@@ -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", ">= 3.0.0"
22
- spec.add_runtime_dependency "money", "~> 6.1.0.beta1"
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
@@ -359,4 +359,4 @@ describe Mongoid::MoneyField do
359
359
  expect(dummy.price3).to eq Monetize.parse('1')
360
360
  end
361
361
  end
362
- end
362
+ end
@@ -41,9 +41,12 @@ describe Money do
41
41
  end
42
42
 
43
43
  context "demongoize" do
44
- subject { Priceable.first.price }
45
- it { is_expected.to be_an_instance_of(Money) }
46
- it { is_expected.to eq(Money.new(100, 'EUR')) }
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
@@ -1,5 +1,5 @@
1
1
  class Priceable
2
2
  include Mongoid::Document
3
3
 
4
- field :price, :type => Money
5
- end
4
+ field :price, :type => MoneyType.new
5
+ 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.2.1
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: 2014-06-08 00:00:00.000000000 Z
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: 3.0.0
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: 3.0.0
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.1.0.beta1
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.1.0.beta1
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.2.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