mongoid_money_field 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +16 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +10 -10
- data/README.rdoc +27 -6
- data/VERSION +1 -1
- data/gemfiles/mongoid2.gemfile +11 -0
- data/gemfiles/mongoid3.gemfile +11 -0
- data/lib/mongoid_money_field.rb +47 -16
- data/mongoid_money_field.gemspec +14 -9
- data/spec/money_spec.rb +46 -3
- data/spec/spec_helper.rb +14 -2
- data/spec/support/dummy_embedded.rb +2 -0
- data/spec/support/dummy_money.rb +3 -2
- data/spec/support/dummy_money_required.rb +10 -0
- data/spec/support/dummy_money_with_default.rb +3 -1
- data/spec/support/dummy_money_with_default_with_currency.rb +3 -1
- data/spec/support/dummy_money_with_fixed_currency.rb +3 -1
- data/spec/support/dummy_money_without_default.rb +3 -1
- data/spec/support/dummy_override_default_currency.rb +10 -0
- data/spec/support/dummy_prices.rb +5 -4
- data/spec/support/dummy_with_default_currency.rb +10 -0
- metadata +12 -7
- data/spec/mongoid.yml +0 -6
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
language: ruby
|
2
|
+
services: mongodb
|
3
|
+
gemfile:
|
4
|
+
- gemfiles/mongoid2.gemfile
|
5
|
+
- gemfiles/mongoid3.gemfile
|
6
|
+
rvm:
|
7
|
+
- 1.9.2
|
8
|
+
- 1.9.3
|
9
|
+
- rbx-19mode
|
10
|
+
- jruby-19mode
|
11
|
+
matrix:
|
12
|
+
exclude:
|
13
|
+
- rvm: 1.9.2
|
14
|
+
gemfile: gemfiles/mongoid3.gemfile
|
15
|
+
- rvm: rbx-19mode
|
16
|
+
gemfile: gemfiles/mongoid2.gemfile
|
data/Gemfile
CHANGED
@@ -4,9 +4,9 @@ gem 'mongoid', '>= 2.4.0'
|
|
4
4
|
gem 'money'
|
5
5
|
|
6
6
|
group :development do
|
7
|
-
gem "rspec", "~> 2.
|
7
|
+
gem "rspec", "~> 2.11.0"
|
8
8
|
gem "rdoc", "~> 3.12"
|
9
|
-
gem "bundler", "~> 1.1
|
9
|
+
gem "bundler", "~> 1.2.1"
|
10
10
|
gem "jeweler", "~> 1.8.3"
|
11
11
|
gem "simplecov", '>= 0.4.0', :require => false
|
12
12
|
gem "database_cleaner", "~> 0.8.0"
|
data/Gemfile.lock
CHANGED
@@ -32,14 +32,14 @@ GEM
|
|
32
32
|
rake (0.9.2.2)
|
33
33
|
rdoc (3.12)
|
34
34
|
json (~> 1.4)
|
35
|
-
rspec (2.
|
36
|
-
rspec-core (~> 2.
|
37
|
-
rspec-expectations (~> 2.
|
38
|
-
rspec-mocks (~> 2.
|
39
|
-
rspec-core (2.
|
40
|
-
rspec-expectations (2.
|
41
|
-
diff-lcs (~> 1.1.
|
42
|
-
rspec-mocks (2.
|
35
|
+
rspec (2.11.0)
|
36
|
+
rspec-core (~> 2.11.0)
|
37
|
+
rspec-expectations (~> 2.11.0)
|
38
|
+
rspec-mocks (~> 2.11.0)
|
39
|
+
rspec-core (2.11.1)
|
40
|
+
rspec-expectations (2.11.3)
|
41
|
+
diff-lcs (~> 1.1.3)
|
42
|
+
rspec-mocks (2.11.3)
|
43
43
|
simplecov (0.6.1)
|
44
44
|
multi_json (~> 1.0)
|
45
45
|
simplecov-html (~> 0.5.3)
|
@@ -50,11 +50,11 @@ PLATFORMS
|
|
50
50
|
ruby
|
51
51
|
|
52
52
|
DEPENDENCIES
|
53
|
-
bundler (~> 1.1
|
53
|
+
bundler (~> 1.2.1)
|
54
54
|
database_cleaner (~> 0.8.0)
|
55
55
|
jeweler (~> 1.8.3)
|
56
56
|
money
|
57
57
|
mongoid (>= 2.4.0)
|
58
58
|
rdoc (~> 3.12)
|
59
|
-
rspec (~> 2.
|
59
|
+
rspec (~> 2.11.0)
|
60
60
|
simplecov (>= 0.4.0)
|
data/README.rdoc
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
== mongoid money field
|
2
2
|
|
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
|
+
|
3
6
|
This is a super simple gem to use RubyMoney money type columns with mongoid
|
4
7
|
|
5
8
|
https://github.com/RubyMoney/money
|
9
|
+
|
6
10
|
https://github.com/mongoid/mongoid
|
7
11
|
|
8
12
|
== Description
|
@@ -11,12 +15,20 @@ A simple gem that creates a Money datatype using RubyMoney for Mongoid.
|
|
11
15
|
|
12
16
|
Inspired by https://gist.github.com/840500
|
13
17
|
|
18
|
+
== updating
|
19
|
+
v3 breaks backwards compatibility in favour of having syntax and defaults similar to field mongoid macro
|
20
|
+
to get the same behaviour as 1.0 please add `default: 0` to field declaration, like this
|
21
|
+
|
22
|
+
money_field :price, default: 0
|
23
|
+
|
24
|
+
please avoid using v2, i realized that API was stupid after commiting it.
|
25
|
+
|
14
26
|
== Installation
|
15
27
|
|
16
28
|
Include the gem in your Gemfile
|
17
29
|
|
18
30
|
gem 'mongoid_money_field'
|
19
|
-
|
31
|
+
|
20
32
|
== Usage
|
21
33
|
|
22
34
|
class DummyMoney
|
@@ -24,15 +36,24 @@ Include the gem in your Gemfile
|
|
24
36
|
include Mongoid::MoneyField
|
25
37
|
|
26
38
|
field :description
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
|
40
|
+
# defaults to 0
|
41
|
+
money_field :cart_total, default: 0
|
42
|
+
|
43
|
+
# defaults to nil
|
44
|
+
money_field :price, :old_price, default: nil # defaults to nil
|
30
45
|
|
31
46
|
# to disallow changing currency (and to not store it in database)
|
32
|
-
|
47
|
+
money_field :price2, fixed_currency: 'GBP'
|
33
48
|
|
34
49
|
# set a default
|
35
|
-
|
50
|
+
money_field :price3, default: '1.23 RUB'
|
51
|
+
|
52
|
+
# make required
|
53
|
+
money_field :price4, required: true, default_currency: nil
|
54
|
+
|
55
|
+
# default_currency is Money.default_currency.iso_code if not specified
|
56
|
+
# fixed_currency overrides default_currency if set
|
36
57
|
end
|
37
58
|
|
38
59
|
All Money values are converted and stored in mongo as cents and currency in two separate fields.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
@@ -0,0 +1,11 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem 'mongoid', '~> 2.4.0'
|
4
|
+
gem 'money'
|
5
|
+
gem "rake", "~> 0.9.2.2"
|
6
|
+
gem "rspec", "~> 2.11.0"
|
7
|
+
gem "rdoc", "~> 3.12"
|
8
|
+
gem "bundler"
|
9
|
+
gem "jeweler", "~> 1.8.3"
|
10
|
+
gem "simplecov", '>= 0.4.0', :require => false
|
11
|
+
gem "database_cleaner", "~> 0.8.0"
|
@@ -0,0 +1,11 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem 'mongoid', '~> 3.0.0'
|
4
|
+
gem 'money'
|
5
|
+
gem "rake", "~> 0.9.2.2"
|
6
|
+
gem "rspec", "~> 2.11.0"
|
7
|
+
gem "rdoc", "~> 3.12"
|
8
|
+
gem "bundler"
|
9
|
+
gem "jeweler", "~> 1.8.3"
|
10
|
+
gem "simplecov", '>= 0.4.0', :require => false
|
11
|
+
gem "database_cleaner", "~> 0.8.0"
|
data/lib/mongoid_money_field.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
require 'money'
|
2
4
|
|
3
5
|
module Mongoid
|
@@ -9,27 +11,56 @@ module Mongoid
|
|
9
11
|
|
10
12
|
module ClassMethods
|
11
13
|
|
12
|
-
def
|
14
|
+
def money_field(*columns)
|
15
|
+
opts = columns.last.is_a?(Hash) ? columns.pop : {}
|
16
|
+
opts = {
|
17
|
+
fixed_currency: nil,
|
18
|
+
default: nil,
|
19
|
+
required: false,
|
20
|
+
default_currency: nil
|
21
|
+
}.merge(opts)
|
22
|
+
|
13
23
|
[columns].flatten.each do |name|
|
14
|
-
|
24
|
+
default_money = nil
|
15
25
|
|
16
26
|
if opts[:default].nil?
|
17
27
|
default = nil
|
18
|
-
default_currency = ::Money.default_currency.iso_code if opts[:fixed_currency].nil?
|
19
28
|
else
|
20
29
|
default_money = Money.parse(opts[:default])
|
21
30
|
default = default_money.cents
|
22
|
-
default_currency = default_money.currency.iso_code if opts[:fixed_currency].nil?
|
23
31
|
end
|
24
32
|
|
25
33
|
attr_cents = (name.to_s + '_cents').to_sym
|
26
|
-
|
34
|
+
attr_currency = (name.to_s + '_currency').to_sym
|
27
35
|
|
36
|
+
field attr_cents, type: Integer, default: default
|
28
37
|
if opts[:fixed_currency].nil?
|
29
|
-
|
30
|
-
|
38
|
+
default_currency = nil
|
39
|
+
if opts[:default_currency].nil?
|
40
|
+
unless default_money.nil?
|
41
|
+
default_currency = default_money.currency.iso_code
|
42
|
+
end
|
43
|
+
else
|
44
|
+
default_currency = opts[:default_currency]
|
45
|
+
end
|
46
|
+
|
47
|
+
field attr_currency, type: String, default: default_currency
|
48
|
+
end
|
49
|
+
|
50
|
+
if opts[:required]
|
51
|
+
validate do
|
52
|
+
cents = read_attribute(attr_cents)
|
53
|
+
|
54
|
+
if cents.nil?
|
55
|
+
errors.add(name, errors.generate_message(name, :error, default: "invalid value for #{name}"))
|
56
|
+
end
|
57
|
+
if opts[:fixed_currency].nil? && read_attribute(attr_currency).nil?
|
58
|
+
errors.add(name, errors.generate_message(name, :error, default: "invalid value for #{name} currency"))
|
59
|
+
end
|
60
|
+
end
|
31
61
|
end
|
32
62
|
|
63
|
+
|
33
64
|
define_method(name) do
|
34
65
|
cents = read_attribute(attr_cents)
|
35
66
|
|
@@ -54,7 +85,15 @@ module Mongoid
|
|
54
85
|
end
|
55
86
|
nil
|
56
87
|
else
|
57
|
-
|
88
|
+
if opts[:default_currency].nil?
|
89
|
+
money = value.to_money
|
90
|
+
else
|
91
|
+
old_default = Money.default_currency
|
92
|
+
Money.default_currency = Money::Currency.new(opts[:default_currency])
|
93
|
+
money = value.to_money
|
94
|
+
Money.default_currency = old_default
|
95
|
+
end
|
96
|
+
|
58
97
|
write_attribute(attr_cents, money.cents)
|
59
98
|
if opts[:fixed_currency].nil?
|
60
99
|
write_attribute(attr_currency, money.currency.iso_code)
|
@@ -64,14 +103,6 @@ module Mongoid
|
|
64
103
|
end
|
65
104
|
end
|
66
105
|
end
|
67
|
-
|
68
|
-
def money_field(*columns)
|
69
|
-
money_field_with_options(columns, default: 0)
|
70
|
-
end
|
71
|
-
|
72
|
-
def money_field_without_default(*columns)
|
73
|
-
money_field_with_options(columns)
|
74
|
-
end
|
75
106
|
end
|
76
107
|
end
|
77
108
|
end
|
data/mongoid_money_field.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "mongoid_money_field"
|
8
|
-
s.version = "
|
8
|
+
s.version = "3.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["glebtv"]
|
@@ -19,24 +19,29 @@ Gem::Specification.new do |s|
|
|
19
19
|
".document",
|
20
20
|
".rspec",
|
21
21
|
".rvmrc",
|
22
|
+
".travis.yml",
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
24
25
|
"MIT-LICENSE.txt",
|
25
26
|
"README.rdoc",
|
26
27
|
"Rakefile",
|
27
28
|
"VERSION",
|
29
|
+
"gemfiles/mongoid2.gemfile",
|
30
|
+
"gemfiles/mongoid3.gemfile",
|
28
31
|
"lib/mongoid_money_field.rb",
|
29
32
|
"mongoid_money_field.gemspec",
|
30
33
|
"spec/money_spec.rb",
|
31
|
-
"spec/mongoid.yml",
|
32
34
|
"spec/spec_helper.rb",
|
33
35
|
"spec/support/dummy_embedded.rb",
|
34
36
|
"spec/support/dummy_money.rb",
|
37
|
+
"spec/support/dummy_money_required.rb",
|
35
38
|
"spec/support/dummy_money_with_default.rb",
|
36
39
|
"spec/support/dummy_money_with_default_with_currency.rb",
|
37
40
|
"spec/support/dummy_money_with_fixed_currency.rb",
|
38
41
|
"spec/support/dummy_money_without_default.rb",
|
39
|
-
"spec/support/
|
42
|
+
"spec/support/dummy_override_default_currency.rb",
|
43
|
+
"spec/support/dummy_prices.rb",
|
44
|
+
"spec/support/dummy_with_default_currency.rb"
|
40
45
|
]
|
41
46
|
s.homepage = "http://github.com/glebtv/mongoid_money_field"
|
42
47
|
s.licenses = ["MIT"]
|
@@ -50,18 +55,18 @@ Gem::Specification.new do |s|
|
|
50
55
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
56
|
s.add_runtime_dependency(%q<mongoid>, [">= 2.4.0"])
|
52
57
|
s.add_runtime_dependency(%q<money>, [">= 0"])
|
53
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.
|
58
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
|
54
59
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
55
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.1
|
60
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.2.1"])
|
56
61
|
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
57
62
|
s.add_development_dependency(%q<simplecov>, [">= 0.4.0"])
|
58
63
|
s.add_development_dependency(%q<database_cleaner>, ["~> 0.8.0"])
|
59
64
|
else
|
60
65
|
s.add_dependency(%q<mongoid>, [">= 2.4.0"])
|
61
66
|
s.add_dependency(%q<money>, [">= 0"])
|
62
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
67
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
63
68
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
64
|
-
s.add_dependency(%q<bundler>, ["~> 1.1
|
69
|
+
s.add_dependency(%q<bundler>, ["~> 1.2.1"])
|
65
70
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
66
71
|
s.add_dependency(%q<simplecov>, [">= 0.4.0"])
|
67
72
|
s.add_dependency(%q<database_cleaner>, ["~> 0.8.0"])
|
@@ -69,9 +74,9 @@ Gem::Specification.new do |s|
|
|
69
74
|
else
|
70
75
|
s.add_dependency(%q<mongoid>, [">= 2.4.0"])
|
71
76
|
s.add_dependency(%q<money>, [">= 0"])
|
72
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
77
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
73
78
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
74
|
-
s.add_dependency(%q<bundler>, ["~> 1.1
|
79
|
+
s.add_dependency(%q<bundler>, ["~> 1.2.1"])
|
75
80
|
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
76
81
|
s.add_dependency(%q<simplecov>, [">= 0.4.0"])
|
77
82
|
s.add_dependency(%q<database_cleaner>, ["~> 0.8.0"])
|
data/spec/money_spec.rb
CHANGED
@@ -1,9 +1,52 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Mongoid::MoneyField do
|
4
|
-
|
6
|
+
|
7
|
+
describe 'when money field is required' do
|
8
|
+
it 'should be valid to save when field is filled in' do
|
9
|
+
dummy = DummyMoneyRequired.new
|
10
|
+
dummy.price = '$10'
|
11
|
+
dummy.should be_valid
|
12
|
+
dummy.save.should eq true
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should be not valid to save when field is not filled in' do
|
16
|
+
dummy = DummyMoneyRequired.new
|
17
|
+
dummy.should_not be_valid
|
18
|
+
dummy.errors.count.should eq 2
|
19
|
+
dummy.errors.messages[:price][0].should eq "invalid value for price"
|
20
|
+
dummy.errors.messages[:price][1].should eq "invalid value for price currency"
|
21
|
+
dummy.save.should eq false
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'should be not valid to save when field is filled in but currency is not' do
|
25
|
+
dummy = DummyMoneyRequired.new
|
26
|
+
dummy.price_cents = 123
|
27
|
+
dummy.should_not be_valid
|
28
|
+
dummy.errors.count.should eq 1
|
29
|
+
dummy.errors.messages[:price][0].should eq "invalid value for price currency"
|
30
|
+
dummy.save.should eq false
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'when both default currency and fixed currency is specified' do
|
35
|
+
it 'should use fixed currency instead of default' do
|
36
|
+
DummyOverrideDefaultCurrency.create!(price: '1.23')
|
37
|
+
DummyOverrideDefaultCurrency.first.price.currency.iso_code.should eq 'GBP'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'when default currency is specified' do
|
42
|
+
it 'should use it instead of Money.default_currency' do
|
43
|
+
DummyWithDefaultCurrency.create!(price: '1.23')
|
44
|
+
DummyWithDefaultCurrency.first.price.currency.iso_code.should eq 'EUR'
|
45
|
+
Money.default_currency.iso_code.should eq 'RUB'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
5
49
|
describe 'when persisting a document with a Money datatype' do
|
6
|
-
|
7
50
|
it 'should be persisted normally when set as dollars' do
|
8
51
|
dummy = DummyMoney.new
|
9
52
|
dummy.price = '$10'
|
@@ -99,7 +142,7 @@ describe Mongoid::MoneyField do
|
|
99
142
|
dummy.price.currency.iso_code.should eq Money.default_currency.iso_code
|
100
143
|
dummy.price.cents.should eq 100
|
101
144
|
|
102
|
-
dummy.
|
145
|
+
dummy.price2.should be_nil
|
103
146
|
|
104
147
|
dummy.price1.cents.should eq 0
|
105
148
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
4
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
5
|
require 'rspec'
|
@@ -15,8 +17,18 @@ Money.default_currency = Money::Currency.new("RUB")
|
|
15
17
|
# Requires supporting files with custom matchers and macros, etc,
|
16
18
|
# in ./support/ and its subdirectories.
|
17
19
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
18
|
-
|
19
|
-
|
20
|
+
|
21
|
+
def mongoid3?
|
22
|
+
defined?(Mongoid::VERSION) && Gem::Version.new(Mongoid::VERSION) >= Gem::Version.new('3.0.0.rc')
|
23
|
+
end
|
24
|
+
|
25
|
+
Mongoid.configure do |config|
|
26
|
+
if mongoid3?
|
27
|
+
config.sessions[:default] = { :database => 'mongoid_money_field_test', :hosts => ['localhost:27017'] }
|
28
|
+
else
|
29
|
+
config.master = Mongo::Connection.new.db('mongoid_money_field_test')
|
30
|
+
end
|
31
|
+
end
|
20
32
|
|
21
33
|
DatabaseCleaner.orm = "mongoid"
|
22
34
|
|
data/spec/support/dummy_money.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
class DummyPrices
|
2
4
|
include Mongoid::Document
|
3
5
|
include Mongoid::MoneyField
|
4
6
|
|
5
7
|
field :description
|
6
8
|
|
7
|
-
money_field :price1, :
|
9
|
+
money_field :price1, default: 0
|
10
|
+
money_field :price2, :price3
|
8
11
|
|
9
|
-
|
10
|
-
|
11
|
-
money_field_without_default :price_nodef
|
12
|
+
money_field :price, default: 1.00
|
12
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_money_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 2.
|
53
|
+
version: 2.11.0
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: 2.11.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rdoc
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 1.1
|
85
|
+
version: 1.2.1
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.1
|
93
|
+
version: 1.2.1
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: jeweler
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,24 +149,29 @@ files:
|
|
149
149
|
- .document
|
150
150
|
- .rspec
|
151
151
|
- .rvmrc
|
152
|
+
- .travis.yml
|
152
153
|
- Gemfile
|
153
154
|
- Gemfile.lock
|
154
155
|
- MIT-LICENSE.txt
|
155
156
|
- README.rdoc
|
156
157
|
- Rakefile
|
157
158
|
- VERSION
|
159
|
+
- gemfiles/mongoid2.gemfile
|
160
|
+
- gemfiles/mongoid3.gemfile
|
158
161
|
- lib/mongoid_money_field.rb
|
159
162
|
- mongoid_money_field.gemspec
|
160
163
|
- spec/money_spec.rb
|
161
|
-
- spec/mongoid.yml
|
162
164
|
- spec/spec_helper.rb
|
163
165
|
- spec/support/dummy_embedded.rb
|
164
166
|
- spec/support/dummy_money.rb
|
167
|
+
- spec/support/dummy_money_required.rb
|
165
168
|
- spec/support/dummy_money_with_default.rb
|
166
169
|
- spec/support/dummy_money_with_default_with_currency.rb
|
167
170
|
- spec/support/dummy_money_with_fixed_currency.rb
|
168
171
|
- spec/support/dummy_money_without_default.rb
|
172
|
+
- spec/support/dummy_override_default_currency.rb
|
169
173
|
- spec/support/dummy_prices.rb
|
174
|
+
- spec/support/dummy_with_default_currency.rb
|
170
175
|
homepage: http://github.com/glebtv/mongoid_money_field
|
171
176
|
licenses:
|
172
177
|
- MIT
|
@@ -182,7 +187,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
182
187
|
version: '0'
|
183
188
|
segments:
|
184
189
|
- 0
|
185
|
-
hash:
|
190
|
+
hash: 2451846497476326695
|
186
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
192
|
none: false
|
188
193
|
requirements:
|