money_with_date 0.4.0 → 0.5.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 +4 -4
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +4 -4
- data/Gemfile_test +7 -1
- data/README.md +7 -10
- data/lib/money_with_date/active_record/monetizable.rb +23 -7
- data/lib/money_with_date/version.rb +3 -3
- data/money_with_date.gemspec +1 -1
- metadata +6 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c882466426f32c18819782c6de254ec34194c4a8714e7c9c49713c8248d16cd
|
|
4
|
+
data.tar.gz: ca6a54db86d677feade11354c29420785e4cbf70841f7e6c7db580364faafbb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d1601dbe8066ae5284e3747c3ed35eb0db6544f97fe3199ecd9e2654d8d06d4ae91d9eb9b78b9b958f7bdd669ca2a7e0362615a858786d41bda480f16363353
|
|
7
|
+
data.tar.gz: 90e451547eeda86cfc97fe67f86777b2ffa84a3b1f2f4b017a5ff0f95f9b3f1c441e23e0181ca5d8e822c5606bd5c0fdfbf14fd03b9fcf2369191892a2e3f770
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.5.0] - 2026-07-06
|
|
4
|
+
|
|
5
|
+
- Update supported versions ([#8](https://github.com/infinum/money_with_date/pull/8))
|
|
6
|
+
|
|
7
|
+
**Breaking**: drops support for Ruby 3.0
|
|
8
|
+
|
|
3
9
|
## [0.4.0] - 2024-09-06
|
|
4
10
|
|
|
5
11
|
- Update supported versions ([#7](https://github.com/infinum/money_with_date/pull/7))
|
data/Gemfile.lock
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
money_with_date (0.
|
|
5
|
-
money (>= 6.14.0, <=
|
|
4
|
+
money_with_date (0.5.0)
|
|
5
|
+
money (>= 6.14.0, <= 7.0.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
ast (2.4.2)
|
|
11
11
|
coderay (1.1.3)
|
|
12
|
-
concurrent-ruby (1.3.
|
|
12
|
+
concurrent-ruby (1.3.7)
|
|
13
13
|
diff-lcs (1.5.1)
|
|
14
14
|
i18n (1.14.5)
|
|
15
15
|
concurrent-ruby (~> 1.0)
|
|
@@ -74,4 +74,4 @@ DEPENDENCIES
|
|
|
74
74
|
rubocop-rspec
|
|
75
75
|
|
|
76
76
|
BUNDLED WITH
|
|
77
|
-
|
|
77
|
+
4.0.3
|
data/Gemfile_test
CHANGED
|
@@ -6,9 +6,11 @@ gemspec
|
|
|
6
6
|
|
|
7
7
|
gem "money", ENV["MONEY_VERSION"] if ENV["MONEY_VERSION"]
|
|
8
8
|
gem "money-rails", ENV["MONEY_RAILS_VERSION"] if ENV["MONEY_RAILS_VERSION"]
|
|
9
|
-
gem "activerecord", ENV["RAILS_VERSION"] if ENV["RAILS_VERSION"]
|
|
10
9
|
|
|
11
10
|
if ENV["RAILS_VERSION"]
|
|
11
|
+
gem "logger"
|
|
12
|
+
gem "activerecord", ENV["RAILS_VERSION"]
|
|
13
|
+
|
|
12
14
|
if Gem::Version.new(ENV.fetch("RAILS_VERSION").delete_prefix("~> ")) >= Gem::Version.new("7.1.0")
|
|
13
15
|
gem "sqlite3"
|
|
14
16
|
else
|
|
@@ -16,5 +18,9 @@ if ENV["RAILS_VERSION"]
|
|
|
16
18
|
end
|
|
17
19
|
end
|
|
18
20
|
|
|
21
|
+
gem "base64"
|
|
22
|
+
gem "benchmark"
|
|
23
|
+
gem "bigdecimal"
|
|
24
|
+
gem "mutex_m"
|
|
19
25
|
gem "rubyzip"
|
|
20
26
|
gem "simplecov", require: false
|
data/README.md
CHANGED
|
@@ -332,18 +332,15 @@ Money.default_date_column = nil
|
|
|
332
332
|
## Supported Versions
|
|
333
333
|
|
|
334
334
|
`money_with_date` has the following version requirements:
|
|
335
|
-
- Ruby: **>= 3.
|
|
336
|
-
- money: **>= 6.14.0** and **<=
|
|
337
|
-
- money-rails:
|
|
335
|
+
- Ruby: **>= 3.1.0**
|
|
336
|
+
- money: **>= 6.14.0** and **<= 7.0.2**
|
|
337
|
+
- money-rails: **>= 1.15.0** and **<= 3.0.0**
|
|
338
338
|
|
|
339
339
|
The gem has been tested against all possible combinations of supported Ruby, Rails, money, and money-rails versions:
|
|
340
|
-
- Ruby: `3.
|
|
341
|
-
- Rails: `~> 6.1.0`, `~> 7.0.0`, `~> 7.1.0` and `~>
|
|
342
|
-
- money: `6.14.0`, `6.14.1`, `6.16.0`, `6.17.0`, `6.18.0
|
|
343
|
-
- money-rails: `1.15.0`
|
|
344
|
-
|
|
345
|
-
The following combinations have been excluded from the test matrix because of incompatibility:
|
|
346
|
-
- Ruby `3.0` with Rails `~> 7.2.0`
|
|
340
|
+
- Ruby: `3.1`, `3.2`, `3.3`, `3.4` and `4.0`
|
|
341
|
+
- Rails: `~> 6.1.0`, `~> 7.0.0`, `~> 7.1.0`, `~> 7.2.0`, `~> 8.0.0` and `~> 8.1.0`
|
|
342
|
+
- money: `6.14.0`, `6.14.1`, `6.16.0`, `6.17.0`, `6.18.0`, `6.19.0`, `7.0.0`, `7.0.1` and `7.0.2`
|
|
343
|
+
- money-rails: `1.15.0`, `2.0.0` and `3.0.0`
|
|
347
344
|
|
|
348
345
|
In addition to running its own test suite, the CI for this gem also runs [money's](https://github.com/RubyMoney/money/tree/main/spec) and [money-rails's](https://github.com/RubyMoney/money-rails/tree/main/spec) test suites with this gem loaded, to prevent regressions. This has been achieved by cloning their test suites from GitHub and requiring this gem in their spec files. For technical information, check the CI [workflow](.github/workflows/ci.yml).
|
|
349
346
|
|
|
@@ -3,16 +3,32 @@
|
|
|
3
3
|
module MoneyWithDate
|
|
4
4
|
module ActiveRecord
|
|
5
5
|
module Monetizable
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
# :nocov:
|
|
7
|
+
# see https://github.com/RubyMoney/money-rails/pull/670/changes
|
|
8
|
+
if ::Gem::Version.new(::MoneyRails::VERSION) >= ::Gem::Version.new("2.0.0")
|
|
9
|
+
def read_monetized(name, subunit_name, options = {}, *args, **kwargs)
|
|
10
|
+
money = super
|
|
11
|
+
date = find_date_for(options[:with_model_date], options[:with_date])
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
if money&.date == date
|
|
14
|
+
money
|
|
15
|
+
else
|
|
16
|
+
instance_variable_set("@#{name}", money&.with_date(date))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
else
|
|
20
|
+
def read_monetized(name, subunit_name, options = {}, *args)
|
|
21
|
+
money = super
|
|
22
|
+
date = find_date_for(options[:with_model_date], options[:with_date])
|
|
23
|
+
|
|
24
|
+
if money&.date == date
|
|
25
|
+
money
|
|
26
|
+
else
|
|
27
|
+
instance_variable_set("@#{name}", money&.with_date(date))
|
|
28
|
+
end
|
|
14
29
|
end
|
|
15
30
|
end
|
|
31
|
+
# :nocov:
|
|
16
32
|
|
|
17
33
|
private
|
|
18
34
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module MoneyWithDate
|
|
4
|
-
VERSION = "0.
|
|
4
|
+
VERSION = "0.5.0"
|
|
5
5
|
|
|
6
6
|
MINIMUM_MONEY_VERSION = "6.14.0"
|
|
7
7
|
MINIMUM_MONEY_RAILS_VERSION = "1.15.0"
|
|
8
8
|
|
|
9
|
-
MAXIMUM_MONEY_VERSION = "
|
|
10
|
-
MAXIMUM_MONEY_RAILS_VERSION = "
|
|
9
|
+
MAXIMUM_MONEY_VERSION = "7.0.2"
|
|
10
|
+
MAXIMUM_MONEY_RAILS_VERSION = "3.0.0"
|
|
11
11
|
end
|
data/money_with_date.gemspec
CHANGED
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
spec.summary = "Extension for the money gem which adds dates to Money objects"
|
|
12
12
|
spec.homepage = "https://github.com/infinum/money_with_date"
|
|
13
13
|
spec.license = "MIT"
|
|
14
|
-
spec.required_ruby_version = ">= 3.
|
|
14
|
+
spec.required_ruby_version = ">= 3.1.0"
|
|
15
15
|
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
17
17
|
spec.metadata["source_code_uri"] = spec.homepage
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: money_with_date
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lovro Bikić
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: money
|
|
@@ -19,7 +18,7 @@ dependencies:
|
|
|
19
18
|
version: 6.14.0
|
|
20
19
|
- - "<="
|
|
21
20
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
21
|
+
version: 7.0.2
|
|
23
22
|
type: :runtime
|
|
24
23
|
prerelease: false
|
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,7 +28,7 @@ dependencies:
|
|
|
29
28
|
version: 6.14.0
|
|
30
29
|
- - "<="
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
31
|
+
version: 7.0.2
|
|
33
32
|
- !ruby/object:Gem::Dependency
|
|
34
33
|
name: pry
|
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,7 +113,6 @@ dependencies:
|
|
|
114
113
|
- - ">="
|
|
115
114
|
- !ruby/object:Gem::Version
|
|
116
115
|
version: '0'
|
|
117
|
-
description:
|
|
118
116
|
email:
|
|
119
117
|
- lovro.bikic@gmail.com
|
|
120
118
|
executables: []
|
|
@@ -149,7 +147,6 @@ metadata:
|
|
|
149
147
|
source_code_uri: https://github.com/infinum/money_with_date
|
|
150
148
|
changelog_uri: https://github.com/infinum/money_with_date/blob/master/CHANGELOG.md
|
|
151
149
|
rubygems_mfa_required: 'true'
|
|
152
|
-
post_install_message:
|
|
153
150
|
rdoc_options: []
|
|
154
151
|
require_paths:
|
|
155
152
|
- lib
|
|
@@ -157,15 +154,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
157
154
|
requirements:
|
|
158
155
|
- - ">="
|
|
159
156
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: 3.
|
|
157
|
+
version: 3.1.0
|
|
161
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
159
|
requirements:
|
|
163
160
|
- - ">="
|
|
164
161
|
- !ruby/object:Gem::Version
|
|
165
162
|
version: '0'
|
|
166
163
|
requirements: []
|
|
167
|
-
rubygems_version:
|
|
168
|
-
signing_key:
|
|
164
|
+
rubygems_version: 4.0.3
|
|
169
165
|
specification_version: 4
|
|
170
166
|
summary: Extension for the money gem which adds dates to Money objects
|
|
171
167
|
test_files: []
|