Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- **Breaking change**: Drop support for Rails < 7.0
- Allow `super` when overriding methods
- Fix `MoneyRails::ActionViewExtension` not available during eager loading (GH-614)
- Support Mongoid 8.x and 9.x

## 2.0.0

Expand Down
17 changes: 17 additions & 0 deletions gemfiles/mongoid8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
eval_gemfile "../Gemfile"

gem "mongoid", "~> 8.0"
gem "rails", "~> 7.0.0"
gem "sprockets-rails"

platforms :ruby do
gem "sqlite3", "~> 1.4"
end

platforms :jruby do
gem "activerecord-jdbc-adapter"
gem "activerecord-jdbcsqlite3-adapter"
gem "jruby-openssl"
end

gem "database_cleaner-mongoid"
17 changes: 17 additions & 0 deletions gemfiles/mongoid9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
eval_gemfile "../Gemfile"

gem "mongoid", "~> 9.0"
gem "rails", "~> 7.0.0"
gem "sprockets-rails"

platforms :ruby do
gem "sqlite3", "~> 1.4"
end

platforms :jruby do
gem "activerecord-jdbc-adapter"
gem "activerecord-jdbcsqlite3-adapter"
gem "jruby-openssl"
end

gem "database_cleaner-mongoid"
4 changes: 2 additions & 2 deletions lib/money-rails/mongoid/money.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class Money
# Converts an object of this instance into a database friendly value.
def mongoize
{
cents: cents.mongoize.to_f,
currency_iso: currency.iso_code.mongoize
cents: cents.to_f,
currency_iso: currency.iso_code
}
end

Expand Down