money-rails 1.13.4 → 1.14.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 618663a78af12610ff9901dd5ed3b3e5e5bf74d6d24b65141a52b2811179a0d8
4
- data.tar.gz: 0724c64933122f73af34f1ad606c309e40c224a8b8636053ca437145527a8490
3
+ metadata.gz: 8226863e954671b603c22fac3eae1667b81ba88eb3425b8c9cd798e2cfa2f303
4
+ data.tar.gz: cc9c7c8fbc27bcc9343ad457f596b15594a576d0da93448d3bfbabe1caedcfbb
5
5
  SHA512:
6
- metadata.gz: d0b87a85f4fe133e3fc75d75722c42dbb445c05cc98ebe7d242d8b63a27d8b879d324d37a8ca9b1ee24fddc8c0381152cd04e449dc8f8c041ec1598371760551
7
- data.tar.gz: c984f12a0162f918b6d5c67b009da28d37a96a63ee0db664a8778e03503d60064ad9e8227d2e1d4fd37f61098f235445f0b959b7612aa503a1b90416f70b69c0
6
+ metadata.gz: 0ed641980d3b776a3b2ec80d9ff1e7247415248eeff0bdc3fbc7077ad7700171fdcbda6c4c13bf39c2cda063a9fdf2575b660f9625fb506e8d39a815b96ab02f
7
+ data.tar.gz: 301fbd73c779ac54d60e1be7137df6e0a89974b0372d1667fe9eb69c2a8e40c309768bcda6d885f1d6e7168512d2e62a61562ea2189dcd1bba14c53d58b1b891
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.14.0
4
+
5
+ - Tweaks to support Ruby 3.0
6
+
3
7
  ## 1.13.4
4
8
 
5
9
  - Fix validator race condition
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2012 Andreas Loupasakis
2
-
3
1
  MIT License
4
2
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
3
+ Copyright (c) 2012 Andreas Loupasakis
4
+ Copyright (c) 2021 Shane Emmons
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
12
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
15
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
data/README.md CHANGED
@@ -587,4 +587,4 @@ If you are testing against mongoid, make sure to have the mongod process running
587
587
 
588
588
  ## License
589
589
 
590
- MIT License. Copyright 2012-2014 RubyMoney.
590
+ MIT License. Copyright 2021 RubyMoney.
data/Rakefile CHANGED
@@ -55,6 +55,13 @@ namespace :spec do
55
55
  framework, version = file_name.split(/(\d+)/)
56
56
  major, minor = version.split(//)
57
57
 
58
+ # Ruby 3 exclusions
59
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
60
+ # Rails 5 does not support ruby-3.0.0 https://github.com/rails/rails/issues/40938#issuecomment-751569171
61
+ # Mongoid gem does not yet support ruby-3.0.0 https://github.com/mongodb/mongoid#compatibility
62
+ next if framework == 'mongoid' || (framework == 'rails' && version == "5")
63
+ end
64
+
58
65
  frameworks_versions[framework] ||= []
59
66
  frameworks_versions[framework] << file_name
60
67
 
@@ -79,12 +79,12 @@ module MoneyRails
79
79
  attr_name = attr.to_s.tr('.', '_').humanize
80
80
  attr_name = record.class.human_attribute_name(attr, default: attr_name)
81
81
 
82
- record.errors.add(attr, :invalid_currency, {
82
+ record.errors.add(attr, :invalid_currency,
83
83
  thousands: details.thousands_separator,
84
84
  decimal: details.decimal_mark,
85
85
  currency: details.abs_raw_value,
86
86
  attribute: attr_name
87
- })
87
+ )
88
88
  end
89
89
 
90
90
  def value_has_too_many_decimal_points(details)
@@ -5,7 +5,8 @@ module MoneyRails
5
5
  def add_monetize(table_name, accessor, options={})
6
6
  [:amount, :currency].each do |attribute|
7
7
  column_present, *opts = OptionsExtractor.extract attribute, table_name, accessor, options
8
- add_column(*opts) if column_present
8
+ constraints = opts.pop
9
+ add_column(*opts, **constraints) if column_present
9
10
  end
10
11
  end
11
12
 
@@ -5,7 +5,8 @@ module MoneyRails
5
5
  def monetize(accessor, options={})
6
6
  [:amount, :currency].each do |attribute|
7
7
  column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, options
8
- column(*opts) if column_present
8
+ constraints = opts.pop
9
+ column(*opts, **constraints) if column_present
9
10
  end
10
11
  end
11
12
 
@@ -1,3 +1,3 @@
1
1
  module MoneyRails
2
- VERSION = '1.13.4'
2
+ VERSION = '1.14.0'
3
3
  end
data/money-rails.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.add_development_dependency "rspec-rails", "~> 3.0"
37
37
  s.add_development_dependency 'database_cleaner', '~> 1.6.1'
38
38
  s.add_development_dependency 'test-unit', '~> 3.0' if RUBY_VERSION >= '2.2'
39
+ s.add_development_dependency 'bundler'
39
40
 
40
41
  if s.respond_to?(:metadata)
41
42
  s.metadata['changelog_uri'] = 'https://github.com/RubyMoney/money-rails/blob/master/CHANGELOG.md'
@@ -1,60 +1,59 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
5
4
  #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
11
10
  #
12
11
  # It's strongly recommended that you check this file into your version control system.
13
12
 
14
- ActiveRecord::Schema.define(version: 20151026220420) do
13
+ ActiveRecord::Schema.define(version: 2015_10_26_220420) do
15
14
 
16
15
  create_table "dummy_products", force: :cascade do |t|
17
- t.string "currency"
18
- t.integer "price_cents"
16
+ t.string "currency"
17
+ t.integer "price_cents"
19
18
  t.datetime "created_at"
20
19
  t.datetime "updated_at"
21
20
  end
22
21
 
23
22
  create_table "products", force: :cascade do |t|
24
- t.integer "price_cents"
25
- t.integer "discount"
23
+ t.integer "price_cents"
24
+ t.integer "discount"
26
25
  t.datetime "created_at"
27
26
  t.datetime "updated_at"
28
- t.integer "bonus_cents"
29
- t.integer "optional_price_cents"
30
- t.integer "sale_price_amount", default: 0, null: false
31
- t.string "sale_price_currency_code"
32
- t.integer "price_in_a_range_cents"
33
- t.integer "validates_method_amount_cents"
34
- t.integer "aliased_cents"
35
- t.integer "delivery_fee_cents"
36
- t.integer "restock_fee_cents"
37
- t.integer "reduced_price_cents"
38
- t.string "reduced_price_currency"
39
- t.integer "special_price_cents"
40
- t.integer "lambda_price_cents"
41
- t.string "skip_validation_price_cents"
27
+ t.integer "bonus_cents"
28
+ t.integer "optional_price_cents"
29
+ t.integer "sale_price_amount", default: 0, null: false
30
+ t.string "sale_price_currency_code"
31
+ t.integer "price_in_a_range_cents"
32
+ t.integer "validates_method_amount_cents"
33
+ t.integer "aliased_cents"
34
+ t.integer "delivery_fee_cents"
35
+ t.integer "restock_fee_cents"
36
+ t.integer "reduced_price_cents"
37
+ t.string "reduced_price_currency"
38
+ t.integer "special_price_cents"
39
+ t.integer "lambda_price_cents"
40
+ t.string "skip_validation_price_cents"
42
41
  end
43
42
 
44
43
  create_table "services", force: :cascade do |t|
45
- t.integer "charge_cents"
46
- t.integer "discount_cents"
44
+ t.integer "charge_cents"
45
+ t.integer "discount_cents"
47
46
  t.datetime "created_at"
48
47
  t.datetime "updated_at"
49
48
  end
50
49
 
51
50
  create_table "transactions", force: :cascade do |t|
52
- t.integer "amount_cents"
53
- t.integer "tax_cents"
54
- t.string "currency"
51
+ t.integer "amount_cents"
52
+ t.integer "tax_cents"
53
+ t.string "currency"
55
54
  t.datetime "created_at"
56
55
  t.datetime "updated_at"
57
- t.integer "optional_amount_cents"
56
+ t.integer "optional_amount_cents"
58
57
  end
59
58
 
60
59
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: money-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.4
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Loupasakis
8
8
  - Shane Emmons
9
9
  - Simone Carletti
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-01-07 00:00:00.000000000 Z
13
+ date: 2021-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: money
@@ -124,6 +124,20 @@ dependencies:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '3.0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: bundler
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
127
141
  description: This library provides integration of RubyMoney - Money gem with Rails
128
142
  email:
129
143
  - alup.rubymoney@gmail.com
@@ -236,7 +250,7 @@ metadata:
236
250
  changelog_uri: https://github.com/RubyMoney/money-rails/blob/master/CHANGELOG.md
237
251
  source_code_uri: https://github.com/RubyMoney/money-rails/
238
252
  bug_tracker_uri: https://github.com/RubyMoney/money-rails/issues
239
- post_install_message:
253
+ post_install_message:
240
254
  rdoc_options: []
241
255
  require_paths:
242
256
  - lib
@@ -251,8 +265,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
265
  - !ruby/object:Gem::Version
252
266
  version: '0'
253
267
  requirements: []
254
- rubygems_version: 3.1.2
255
- signing_key:
268
+ rubygems_version: 3.2.3
269
+ signing_key:
256
270
  specification_version: 4
257
271
  summary: Money gem integration with Rails
258
272
  test_files: