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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 205d9eb9b1d27048756b4f65f2e65781ae71f131d1d838a1834ea733349d3bf4
4
- data.tar.gz: ea2dfd05351ae59717737a0770480c1eeb6cf484264c9daea064c87ac80dd4a0
3
+ metadata.gz: f55a3c6c12d63ec3bcd7fe8aded08cefcb61d9fc21491ce49d3057064fcbe18c
4
+ data.tar.gz: dc620d935db6c7d606286bbcbb786e75ccaec3e8437eaf7cdeb7b1cd94f5f433
5
5
  SHA512:
6
- metadata.gz: a3e434d199296b8d9a22db937b2b40af35eec147a7fdc1d4a1c1a387a3a0300b806381f2e98cb3a3dfc40371b1087f1529a3a81b399b91dff4d4f454034f39c4
7
- data.tar.gz: 8552a6d4d6c8f6567a4300c6540b04c00ca220b52b3deb0f0ba00af1fb40d0c974110eb97f04d3d0acb8d037f32852d61cd4a55a6b8d2dc17cbc398c9e58c6d4
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(:test) do |t|
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]
@@ -49,6 +49,6 @@ module Mint
49
49
  end
50
50
 
51
51
  ActiveSupport.on_load(:active_record) do
52
- ActiveRecord::Base.include Mint::MoneyAttribute
52
+ ActiveSupport.on_load(:active_record) { include Mint::MoneyAttribute }
53
53
  ActiveRecord::Type.register(:mint_money, Mint::MintMoneyType)
54
54
  end
@@ -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
- return amount if amount.currency == currency
19
- raise TypeError, "Cannot automatically convert #{amount} to #{currency.code}"
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
- alias_method :call, :parse
25
+ alias call parse
25
26
  end
26
27
  end
27
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mint
4
4
  module MoneyAttribute
5
- VERSION = '0.7.0'
5
+ VERSION = '0.7.1'
6
6
  end
7
7
  end
@@ -15,7 +15,7 @@ module Mint
15
15
  else
16
16
  code, subunit, symbol = *currency_data
17
17
  end
18
- Mint.register_currency(code:, subunit:, symbol:)
18
+ Mint.register_currency(code:, subunit:, symbol:)
19
19
  end
20
20
  end
21
21
  end
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.0
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: 1980-01-02 00:00:00.000000000 Z
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: 4.0.9
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: []