money-rails 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +5 -2
- data/lib/money-rails/version.rb +1 -1
- data/money-rails.gemspec +2 -2
- data/spec/active_record/migration_extensions/schema_statements_spec.rb +4 -2
- data/spec/active_record/migration_extensions/table_spec.rb +4 -2
- data/spec/active_record/monetizable_spec.rb +6 -6
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84b727182c1db1168ce04b8ff16e96bfe4607b6c
|
4
|
+
data.tar.gz: e7ad11eca117fa5a7b7a1f8f941c4876d4b898eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdccd1bba23586013586dab5460f136eb6fd5fbf72e531c935314cd1c9a243f4358cc8ed18fa5f29c08ebcc9372cc4c6e18eebcd303a957118fb74fb8d12425a
|
7
|
+
data.tar.gz: e4942ea49fd18149c4c414516a43c2d49ae978cbd32281bd6e4e2bc3a864b7c86e5084fd67e2508cab5ef0c2afb6dcb8e36d0a1e5e266bc347fbf0590fb89493
|
data/Rakefile
CHANGED
@@ -47,6 +47,9 @@ namespace :spec do
|
|
47
47
|
desc "Run Tests against mongoid (version 2)"
|
48
48
|
task(:mongoid2) { run_with_gemfile 'gemfiles/mongoid2.gemfile' }
|
49
49
|
|
50
|
+
desc "Run Tests against rails 4.2"
|
51
|
+
task(:rails42) { run_with_gemfile 'gemfiles/rails42.gemfile' }
|
52
|
+
|
50
53
|
desc "Run Tests against rails 4.1"
|
51
54
|
task(:rails41) { run_with_gemfile 'gemfiles/rails41.gemfile' }
|
52
55
|
|
@@ -59,8 +62,8 @@ namespace :spec do
|
|
59
62
|
desc "Run Tests against mongoid 2 & 3 & 4"
|
60
63
|
task :mongoid => [:mongoid2, :mongoid3, :mongoid4]
|
61
64
|
|
62
|
-
desc "Run Tests against rails 3 & 4 & 4.1"
|
63
|
-
task :rails => [:rails3, :rails4, :rails41]
|
65
|
+
desc "Run Tests against rails 3 & 4 & 4.1 & 4.2"
|
66
|
+
task :rails => [:rails3, :rails4, :rails41, :rails42]
|
64
67
|
|
65
68
|
desc "Run Tests against all ORMs"
|
66
69
|
task :all => [:rails, :mongoid]
|
data/lib/money-rails/version.rb
CHANGED
data/money-rails.gemspec
CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
|
27
27
|
s.require_path = "lib"
|
28
28
|
|
29
|
-
s.add_dependency "money", "~> 6.
|
30
|
-
s.add_dependency "monetize", "~> 1.
|
29
|
+
s.add_dependency "money", "~> 6.5.0"
|
30
|
+
s.add_dependency "monetize", "~> 1.1.0"
|
31
31
|
s.add_dependency "activesupport", ">= 3.0"
|
32
32
|
s.add_dependency "railties", ">= 3.0"
|
33
33
|
|
@@ -36,7 +36,8 @@ if defined? ActiveRecord
|
|
36
36
|
describe 'amount' do
|
37
37
|
subject { Item.columns_hash['price_cents'] }
|
38
38
|
|
39
|
-
it { expect(subject.default).to eq(0) }
|
39
|
+
it { expect(subject.default.to_i).to eq(0) }
|
40
|
+
it { expect(Item.new.public_send(subject.name)).to eq(0) }
|
40
41
|
it { expect(subject.null).to be(false) }
|
41
42
|
it { expect(subject.type).to eq(:integer) }
|
42
43
|
end
|
@@ -61,7 +62,8 @@ if defined? ActiveRecord
|
|
61
62
|
describe 'amount' do
|
62
63
|
subject { Item.columns_hash['prefix_price_with_full_options_postfix'] }
|
63
64
|
|
64
|
-
it { expect(subject.default).to eq(1) }
|
65
|
+
it { expect(subject.default.to_i).to eq(1) }
|
66
|
+
it { expect(Item.new.public_send(subject.name)).to eq(1) }
|
65
67
|
it { expect(subject.null).to be(true) }
|
66
68
|
it { expect(subject.type).to eq(:decimal) }
|
67
69
|
it { expect(subject.precision).to eq(4) }
|
@@ -37,7 +37,8 @@ if defined? ActiveRecord
|
|
37
37
|
describe 'amount' do
|
38
38
|
subject { Item.columns_hash['price_cents'] }
|
39
39
|
|
40
|
-
it { expect(subject.default).to eq(0) }
|
40
|
+
it { expect(subject.default.to_i).to eq(0) }
|
41
|
+
it { expect(Item.new.public_send(subject.name)).to eq(0) }
|
41
42
|
it { expect(subject.null).to be(false) }
|
42
43
|
it { expect(subject.type).to eq(:integer) }
|
43
44
|
end
|
@@ -62,7 +63,8 @@ if defined? ActiveRecord
|
|
62
63
|
describe 'amount' do
|
63
64
|
subject { Item.columns_hash['prefix_price_with_full_options_postfix'] }
|
64
65
|
|
65
|
-
it { expect(subject.default).to eq(1) }
|
66
|
+
it { expect(subject.default.to_i).to eq(1) }
|
67
|
+
it { expect(Item.new.public_send(subject.name)).to eq(1) }
|
66
68
|
it { expect(subject.null).to be(true) }
|
67
69
|
it { expect(subject.type).to eq(:decimal) }
|
68
70
|
it { expect(subject.precision).to eq(4) }
|
@@ -256,16 +256,16 @@ if defined? ActiveRecord
|
|
256
256
|
expect(product.errors[:price].first).to match(/is not a number/)
|
257
257
|
end
|
258
258
|
|
259
|
-
it "passes validation when amount contains spaces (
|
260
|
-
product.price = "
|
259
|
+
it "passes validation when amount contains spaces (999 999.99)" do
|
260
|
+
product.price = "999 999.99"
|
261
261
|
expect(product).to be_valid
|
262
|
-
expect(product.price_cents).to eq(
|
262
|
+
expect(product.price_cents).to eq(99999999)
|
263
263
|
end
|
264
264
|
|
265
|
-
it "passes validation when amount contains underscores (
|
266
|
-
product.price = "
|
265
|
+
it "passes validation when amount contains underscores (999_999.99)" do
|
266
|
+
product.price = "999_999.99"
|
267
267
|
expect(product).to be_valid
|
268
|
-
expect(product.price_cents).to eq(
|
268
|
+
expect(product.price_cents).to eq(99999999)
|
269
269
|
end
|
270
270
|
|
271
271
|
it "passes validation if money value has correct format" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Loupasakis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-12-
|
13
|
+
date: 2014-12-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: money
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 6.
|
21
|
+
version: 6.5.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 6.
|
28
|
+
version: 6.5.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: monetize
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 1.
|
35
|
+
version: 1.1.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.
|
42
|
+
version: 1.1.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: activesupport
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|