File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
lib/money-rails/active_record Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11# RubyMoney - Money-Rails
22
33[ ![ Gem Version] ( https://badge.fury.io/rb/money-rails.svg )] ( http://badge.fury.io/rb/money-rails )
4- [ ![ Build Status ] ( https://secure.travis-ci.org /RubyMoney/money-rails. svg?branch=master )] ( http ://travis-ci.org /RubyMoney/money-rails)
4+ [ ![ Ruby ] ( https://github.com /RubyMoney/money-rails/actions/workflows/ruby.yml/badge. svg )] ( https ://github.com /RubyMoney/money-rails/actions/workflows/ruby.yml )
55[ ![ License] ( http://img.shields.io/:license-mit-green.svg?style=flat )] ( http://opensource.org/licenses/MIT )
66
77## Introduction
@@ -474,6 +474,12 @@ MoneyRails.configure do |config|
474474 # symbol: nil,
475475 # sign_before_symbol: nil
476476 # }
477+
478+ # Set whether an error should be raised when parsing money values
479+ # This includes assigning to a monetized field with the wrong currency
480+ # Default value is false
481+ #
482+ # config.raise_error_on_money_parsing = true
477483end
478484```
479485
493499* ` amount_column ` : Provide values for the amount column (holding the fractional part of a money object).
494500* ` currency_column ` : Provide default values or even disable (` present: false ` ) the currency column.
495501* ` rounding_mode ` : Set ` Money.rounding_mode ` to one of the BigDecimal constants.
502+ * ` raise_error_on_money_parsing ` : Set whether errors should be raised when parsing money values
496503
497504### Helpers
498505
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class ReadOnlyCurrencyException < MoneyRails::Error; end
1010
1111 module ClassMethods
1212 def monetized_attributes
13- monetized_attributes = @monetized_attributes || { }
13+ monetized_attributes = @monetized_attributes || { } . with_indifferent_access
1414
1515 if superclass . respond_to? ( :monetized_attributes )
1616 monetized_attributes . merge ( superclass . monetized_attributes )
Original file line number Diff line number Diff line change @@ -42,5 +42,6 @@ Gem::Specification.new do |s|
4242 s . metadata [ 'changelog_uri' ] = 'https://github.com/RubyMoney/money-rails/blob/master/CHANGELOG.md'
4343 s . metadata [ 'source_code_uri' ] = 'https://github.com/RubyMoney/money-rails/'
4444 s . metadata [ 'bug_tracker_uri' ] = 'https://github.com/RubyMoney/money-rails/issues'
45+ s . metadata [ 'rubygems_mfa_required' ] = 'true'
4546 end
4647end
You can’t perform that action at this time.
0 commit comments