money-rails 1.15.0 → 3.0.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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -6
  3. data/LICENSE +1 -1
  4. data/README.md +182 -152
  5. data/config/locales/money.pt.yml +4 -0
  6. data/lib/money-rails/active_job/money_serializer.rb +23 -0
  7. data/lib/money-rails/active_record/monetizable.rb +39 -19
  8. data/lib/money-rails/configuration.rb +2 -2
  9. data/lib/money-rails/helpers/action_view_extension.rb +1 -1
  10. data/lib/money-rails/hooks.rb +16 -27
  11. data/lib/money-rails/mongoid/money.rb +4 -14
  12. data/lib/money-rails/test_helpers.rb +4 -4
  13. data/lib/money-rails/version.rb +3 -1
  14. data/lib/money-rails.rb +2 -0
  15. data/money-rails.gemspec +13 -26
  16. metadata +18 -228
  17. data/Rakefile +0 -84
  18. data/lib/money-rails/mongoid/two.rb +0 -35
  19. data/spec/active_record/migration_extensions/schema_statements_spec.rb +0 -101
  20. data/spec/active_record/migration_extensions/table_spec.rb +0 -104
  21. data/spec/active_record/monetizable_spec.rb +0 -1062
  22. data/spec/configuration_spec.rb +0 -147
  23. data/spec/dummy/README.rdoc +0 -261
  24. data/spec/dummy/Rakefile +0 -7
  25. data/spec/dummy/app/assets/config/manifest.js +0 -0
  26. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  27. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  28. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  29. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  30. data/spec/dummy/app/models/dummy_product.rb +0 -8
  31. data/spec/dummy/app/models/priceable.rb +0 -8
  32. data/spec/dummy/app/models/product.rb +0 -59
  33. data/spec/dummy/app/models/service.rb +0 -5
  34. data/spec/dummy/app/models/transaction.rb +0 -13
  35. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  36. data/spec/dummy/config/application.rb +0 -66
  37. data/spec/dummy/config/boot.rb +0 -13
  38. data/spec/dummy/config/database.yml +0 -25
  39. data/spec/dummy/config/environment.rb +0 -5
  40. data/spec/dummy/config/environments/development.rb +0 -30
  41. data/spec/dummy/config/environments/production.rb +0 -69
  42. data/spec/dummy/config/environments/test.rb +0 -36
  43. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  44. data/spec/dummy/config/initializers/inflections.rb +0 -15
  45. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  46. data/spec/dummy/config/initializers/money.rb +0 -31
  47. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  48. data/spec/dummy/config/initializers/session_store.rb +0 -8
  49. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  50. data/spec/dummy/config/locales/en-GB.yml +0 -11
  51. data/spec/dummy/config/locales/en-US.yml +0 -5
  52. data/spec/dummy/config/locales/en.yml +0 -5
  53. data/spec/dummy/config/locales/it.yml +0 -11
  54. data/spec/dummy/config/mongoid.yml +0 -29
  55. data/spec/dummy/config/routes.rb +0 -3
  56. data/spec/dummy/config.ru +0 -4
  57. data/spec/dummy/db/migrate/20120331190108_create_products.rb +0 -10
  58. data/spec/dummy/db/migrate/20120402080348_add_bonus_cents_to_product.rb +0 -6
  59. data/spec/dummy/db/migrate/20120524052716_create_services.rb +0 -10
  60. data/spec/dummy/db/migrate/20120528181002_create_transactions.rb +0 -11
  61. data/spec/dummy/db/migrate/20120528210103_create_dummy_products.rb +0 -10
  62. data/spec/dummy/db/migrate/20120607210247_add_column_that_allows_nil.rb +0 -5
  63. data/spec/dummy/db/migrate/20120712202655_add_sale_price_cents_to_product.rb +0 -7
  64. data/spec/dummy/db/migrate/20130124023419_add_price_in_a_range_cents_to_products.rb +0 -5
  65. data/spec/dummy/db/migrate/20140110194016_add_validates_method_amount_cents_to_products.rb +0 -5
  66. data/spec/dummy/db/migrate/20141005075025_add_aliased_attr_to_products.rb +0 -5
  67. data/spec/dummy/db/migrate/20150107061030_add_delivery_fee_cents_and_restock_fee_cents_to_product.rb +0 -6
  68. data/spec/dummy/db/migrate/20150126231442_add_reduced_price_to_products.rb +0 -6
  69. data/spec/dummy/db/migrate/20150213234410_add_special_price_to_products.rb +0 -5
  70. data/spec/dummy/db/migrate/20150217222612_add_lambda_price_to_products.rb +0 -5
  71. data/spec/dummy/db/migrate/20150303222230_add_skip_validation_price_cents_to_products.rb +0 -5
  72. data/spec/dummy/db/migrate/20151026220420_add_optional_amount_to_transactions.rb +0 -5
  73. data/spec/dummy/db/schema.rb +0 -59
  74. data/spec/dummy/db/structure.sql +0 -21
  75. data/spec/dummy/public/404.html +0 -26
  76. data/spec/dummy/public/422.html +0 -26
  77. data/spec/dummy/public/500.html +0 -25
  78. data/spec/dummy/public/favicon.ico +0 -0
  79. data/spec/dummy/script/rails +0 -6
  80. data/spec/helpers/action_view_extension_spec.rb +0 -189
  81. data/spec/helpers/form_helper_spec.rb +0 -19
  82. data/spec/money_spec.rb +0 -40
  83. data/spec/mongoid/mongoid_spec.rb +0 -130
  84. data/spec/mongoid/two_spec.rb +0 -80
  85. data/spec/spec_helper.rb +0 -23
  86. data/spec/support/database_cleaner.rb +0 -14
  87. data/spec/test_helpers_spec.rb +0 -72
  88. /data/lib/money-rails/active_record/migration_extensions/{schema_statements_pg_rails4.rb → schema_statements_pg.rb} +0 -0
  89. /data/lib/money-rails/active_record/migration_extensions/{table_pg_rails4.rb → table_pg.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bb5642fbc3d57d55b592911898fc1c0beeb8bb42bb21aeea89c89d1d3dc5464
4
- data.tar.gz: 8a5100169dea70dd4bbb8770a2273e59c6b99c555173025bfcc18fb4170fd7d0
3
+ metadata.gz: cb63337354249ecd15c15695c269080edb51883d30b78f833256dbc1222a86b9
4
+ data.tar.gz: 809dcf758b84ae3a66edf286691f031dfc5fb68706cc604742fc5230e7a27c3b
5
5
  SHA512:
6
- metadata.gz: eb7961c60fab97af3a1e867ebcc192fcdc6468bb4239a18f60fb269014f898836051319db22b14c6b7c69b47287f6772be68d29db4e3be6a5d0366b895cea6b4
7
- data.tar.gz: 193580effbe3f55093e418f8ca6a0eea54bbfd6a46f07d0f8641a57d450564739716f69d18e743b839f785cc5d75513c234445a9378430f9bc943220598c51ae
6
+ metadata.gz: f52ce4f9d92e1352a962147882337fb17c04961b0b935760e0011d3d1d3a433250fe0d0cc3d9837943c912b48dda94b0dcdb82919f9fd98334ef894601e4f82b
7
+ data.tar.gz: 0d0fb9c5ef2adb1db3d1de67b7799059cedb5fb52610dc5eb44f605a31e398e37852f51bb583b039fec7ffd05b17a89abf1f9cb8889969078fdcf3c9d34b745a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 3.0.0
6
+
7
+ - **Breaking change**: Drop support for Rails < 7.0
8
+ - Allow `super` when overriding methods
9
+ - Fix `MoneyRails::ActionViewExtension` not available during eager loading (#614)
10
+ - Fix deprecation warning on the ActiveJob serializer to support future Rails 8.2 (#729)
11
+ - Support Mongoid 8.x and 9.x
12
+ - `MoneyRails::TestHelpers` can be used in Minitest
13
+
14
+ ## 2.0.0
15
+
16
+ - **Breaking change**: Requires `money` gem version ~> 7.0.
17
+ See the [Money 7.0 upgrading guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md)
18
+ - **Breaking change**: Requires `monetize` gem version ~> 7.0
19
+ - **Breaking change**: Drop support for Ruby < 3.1 and Rails < 6.1
20
+ - Allow monetizing methods with kwargs
21
+ - Fix `money_only_cents` for negative money
22
+ - Allow `nil` to be set as the default currency
23
+ - Portuguese translation for errors
24
+ - Skip subunit write for non-attributes in `read_monetized`
25
+
26
+ ## 1.15.0
27
+
28
+ - Bump money version to ~> 6.16
29
+ - Tweak to invalid currency message
30
+
3
31
  ## 1.14.1
4
32
 
5
33
  - Fix invalid_currency error definition
@@ -46,7 +74,7 @@
46
74
 
47
75
  - Bump money version to ~> 6.12.0
48
76
  - Bump monetize version to ~> 1.9.0
49
- - BREAKING CHANGE: Fix to rounding logic in this version from 1.11.0 can cause breaking changes for those relying on the incorrect behavior. Eee [the issue](https://github.com/RubyMoney/money-rails/issues/608) for details.
77
+ - BREAKING CHANGE: Fix to rounding logic in this version from 1.11.0 can cause breaking changes for those relying on the incorrect behavior. See [the issue](https://github.com/RubyMoney/money-rails/issues/608) for details.
50
78
 
51
79
  ## 1.11.0
52
80
 
@@ -84,7 +112,7 @@
84
112
  - Fix attribute order possibly affecting the value of monetized attribute
85
113
  - Add support for RailsAdmin (use :money type)
86
114
  - Raise error when gem was unable to infer monetized attribute name
87
- - Revert decimal mark and thousands separator addtion, since formatting should depend on country and locale, instead of currency
115
+ - Revert decimal mark and thousands separator addition, since formatting should depend on country and locale, instead of currency
88
116
 
89
117
  ## 1.6.1
90
118
 
@@ -148,8 +176,8 @@
148
176
  ## 1.1.0
149
177
 
150
178
  - Update dependencies to money 6.4.x and monetize 1.0.x.
151
- - Make subunit setter (e.g. `#price_cents=`) set the `before_type_cast...` va
152
- riable. (Fixes validation errors.)
179
+ - Make subunit setter (e.g. `#price_cents=`) set the `before_type_cast...`
180
+ variable. (Fixes validation errors.)
153
181
  - use HashWithIndifferentAccess instead of Hash for
154
182
  ActiveRecord::Base::monetized_attributes
155
183
  - Let the 'monetize' test helper work when testing against the model's class,
@@ -159,7 +187,7 @@
159
187
  - Upgrade specs to RSpec 3
160
188
  - Use #respond_to? instead of #try? when monetizing an aliased attribute.
161
189
  - Allow aliased attributes to be monetized
162
- - Fix compatability issue with Rails 4.2
190
+ - Fix compatibility issue with Rails 4.2
163
191
  - Allow empty string as thousands separator.
164
192
  - Allow using a lambda to set default_currency
165
193
 
@@ -292,4 +320,3 @@
292
320
  ## 0.0.1
293
321
 
294
322
  - Hello World
295
-
data/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2012 Andreas Loupasakis
4
- Copyright (c) 2021 Shane Emmons
4
+ Copyright (c) 2025 Shane Emmons
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal