Skip to content

Commit

Permalink
Merge branch 'main' into chore/test-against-ruby-33
Browse files Browse the repository at this point in the history
  • Loading branch information
semmons99 authored Mar 13, 2024
2 parents 9245799 + 7cc8e51 commit 31c8fe5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RubyMoney - Money-Rails

[![Gem Version](https://badge.fury.io/rb/money-rails.svg)](http://badge.fury.io/rb/money-rails)
[![Build Status](https://secure.travis-ci.org/RubyMoney/money-rails.svg?branch=master)](http://travis-ci.org/RubyMoney/money-rails)
[![Ruby](https://github.com/RubyMoney/money-rails/actions/workflows/ruby.yml/badge.svg)](https://github.com/RubyMoney/money-rails/actions/workflows/ruby.yml)
[![License](http://img.shields.io/:license-mit-green.svg?style=flat)](http://opensource.org/licenses/MIT)

## Introduction
Expand Down Expand Up @@ -474,6 +474,12 @@ MoneyRails.configure do |config|
# symbol: nil,
# sign_before_symbol: nil
# }

# Set whether an error should be raised when parsing money values
# This includes assigning to a monetized field with the wrong currency
# Default value is false
#
# config.raise_error_on_money_parsing = true
end
```

Expand All @@ -493,6 +499,7 @@ end
* `amount_column`: Provide values for the amount column (holding the fractional part of a money object).
* `currency_column`: Provide default values or even disable (`present: false`) the currency column.
* `rounding_mode`: Set `Money.rounding_mode` to one of the BigDecimal constants.
* `raise_error_on_money_parsing`: Set whether errors should be raised when parsing money values

### Helpers

Expand Down
2 changes: 1 addition & 1 deletion lib/money-rails/active_record/monetizable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ReadOnlyCurrencyException < MoneyRails::Error; end

module ClassMethods
def monetized_attributes
monetized_attributes = @monetized_attributes || {}
monetized_attributes = @monetized_attributes || {}.with_indifferent_access

if superclass.respond_to?(:monetized_attributes)
monetized_attributes.merge(superclass.monetized_attributes)
Expand Down
1 change: 1 addition & 0 deletions money-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ Gem::Specification.new do |s|
s.metadata['changelog_uri'] = 'https://github.com/RubyMoney/money-rails/blob/master/CHANGELOG.md'
s.metadata['source_code_uri'] = 'https://github.com/RubyMoney/money-rails/'
s.metadata['bug_tracker_uri'] = 'https://github.com/RubyMoney/money-rails/issues'
s.metadata['rubygems_mfa_required'] = 'true'
end
end

0 comments on commit 31c8fe5

Please sign in to comment.