minting-rails 0.7.0 → 0.7.1
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.
- checksums.yaml +4 -4
- data/Rakefile +11 -1
- data/lib/minting/money_attribute/money_type.rb +1 -1
- data/lib/minting/money_attribute/parser.rb +4 -3
- data/lib/minting/money_attribute/version.rb +1 -1
- data/lib/minting/railties.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f55a3c6c12d63ec3bcd7fe8aded08cefcb61d9fc21491ce49d3057064fcbe18c
|
|
4
|
+
data.tar.gz: dc620d935db6c7d606286bbcbb786e75ccaec3e8437eaf7cdeb7b1cd94f5f433
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4683ac9e66301ef10168808c4e623dec3539066ba62492f20922ac7f117a6bc48b7270ba31ce3ee948e3f6ca61adff4808013352322f9817cd2638c19dd6e4b
|
|
7
|
+
data.tar.gz: 31299dc881a94df769ec78cc9910668e278022f94fef389816758453f987b092136dda0ab039e50503fa61ba03d41d9f6a9528bc163b312127f212badc6b2759
|
data/Rakefile
CHANGED
|
@@ -6,9 +6,19 @@ require 'rake/testtask'
|
|
|
6
6
|
|
|
7
7
|
task default: :test
|
|
8
8
|
|
|
9
|
-
Rake::TestTask.new(:
|
|
9
|
+
Rake::TestTask.new(:test_run) do |t|
|
|
10
10
|
t.libs << 'test'
|
|
11
11
|
t.libs << 'lib'
|
|
12
12
|
t.test_files = FileList['test/**/*_test.rb']
|
|
13
13
|
t.ruby_opts << '-rtest_helper.rb'
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
desc 'Migrate test database'
|
|
17
|
+
task :test_db_migrate do
|
|
18
|
+
Dir.chdir('test/dummy') do
|
|
19
|
+
sh({ 'RAILS_ENV' => 'test' }, 'bin/rails', 'db:migrate')
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc 'Run tests (migrates test DB first)'
|
|
24
|
+
task test: [:test_db_migrate, :test_run]
|
|
@@ -15,13 +15,14 @@ module Mint
|
|
|
15
15
|
when Numeric then Mint::Money.create(amount, currency)
|
|
16
16
|
when String then Mint::Money.create(amount.to_r, currency)
|
|
17
17
|
when Mint::Money
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
return amount if amount.currency == currency
|
|
19
|
+
|
|
20
|
+
raise TypeError, "Cannot automatically convert #{amount} to #{currency.code}"
|
|
20
21
|
else
|
|
21
22
|
Mint.parse(amount, currency)
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
|
-
|
|
25
|
+
alias call parse
|
|
25
26
|
end
|
|
26
27
|
end
|
|
27
28
|
end
|
data/lib/minting/railties.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: minting-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gilson Ferraz
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-06-13 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: minting
|
|
@@ -68,6 +69,7 @@ metadata:
|
|
|
68
69
|
changelog_uri: https://github.com/gferraz/minting-rails/releases
|
|
69
70
|
bug_tracker_uri: https://github.com/gferraz/minting-rails/issues
|
|
70
71
|
rubygems_mfa_required: 'true'
|
|
72
|
+
post_install_message:
|
|
71
73
|
rdoc_options: []
|
|
72
74
|
require_paths:
|
|
73
75
|
- lib
|
|
@@ -82,7 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
82
84
|
- !ruby/object:Gem::Version
|
|
83
85
|
version: '0'
|
|
84
86
|
requirements: []
|
|
85
|
-
rubygems_version:
|
|
87
|
+
rubygems_version: 3.5.22
|
|
88
|
+
signing_key:
|
|
86
89
|
specification_version: 4
|
|
87
90
|
summary: Money attributes to ActiveRecord
|
|
88
91
|
test_files: []
|