Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate money-rails gem #268

Merged

Conversation

sarvaiyanidhi
Copy link
Contributor

@sarvaiyanidhi sarvaiyanidhi commented Feb 3, 2024

Claim #265

Closes #265

Have used existing column balance of accounts field but value is stored in cents by using as option in model.

Default currency is set in money initializer file to USD

@sarvaiyanidhi
Copy link
Contributor Author

Hi @Shpigford Let me know if implementation looks good to proceed further with tests for the code

@Shpigford
Copy link
Member

Thanks @sarvaiyanidhi! Can you expound on what that balance_cents field is doing compared to the balance field?

(Also going to convert this to a draft PR since it's still in progres)

@Shpigford Shpigford marked this pull request as draft February 3, 2024 16:35
@sarvaiyanidhi
Copy link
Contributor Author

Thanks @sarvaiyanidhi! Can you expound on what that balance_cents field is doing compared to the balance field?

As mentioned in money-rails gem doc, if you are using another database column name, or you prefer another name for the money attribute, then you can provide an as argument with a string value to the monetize macro.

So, as we have a model with an attribute named balance and we have to monetize it with a specific currency, we can use the as option to define the name of the virtual attribute.

In this case, the as: :balance_cents option specifies that the virtual attribute representing the monetized balance should be named balance_cents. This means you can access the Money object through balance_cents in our Ruby code:

<%= humanized_money_with_symbol account.balance_cents %>

so, virtual attribute balance_cents representing the monetized version of their original attribute balance

@Shpigford
Copy link
Member

@sarvaiyanidhi Gotcha! Thanks for the explanation! Overall, looking good.

@sarvaiyanidhi
Copy link
Contributor Author

sarvaiyanidhi commented Feb 4, 2024

Hi @Shpigford I have integrated basic tests for monetize feature.

I was also rethinking on implementation based on your earlier comment on balance and balance_cents attribute which may be confusing in future for others too.

There are two options which can be considered to simplify and clear this

  • Either we update in database current field balance itself to monetize field which will automagically create balance_cents and balance_currency fields.
  • We update current attribute name in database form balance to balance_cents so we can directly use in model without as option.

Right now we have balance field in database which is Integer datatype and balance_cents virtual attribute is Money type.

You can check this article for more reference https://blog.appsignal.com/2023/11/29/keep-your-ruby-code-maintainable-with-money-rails.html

You can play around current implementation in this branch by adding balance like 19.99 from frontend which gets stored in database in balance field as integer 1999 and balance_cents as #<Money fractional:1999 currency:USD>.

Let me know if you want me to implement changes in database field in new branch for your reference or want to look into it later as we proceed with features.

@sarvaiyanidhi sarvaiyanidhi marked this pull request as ready for review February 4, 2024 00:20
@Shpigford
Copy link
Member

@zachgoll what are your thoughts on having both the balance and balance_cents fields?

@Shpigford Shpigford requested a review from zachgoll February 4, 2024 02:21
@rmarescu
Copy link
Contributor

rmarescu commented Feb 4, 2024

Right now we have balance field in database which is Integer datatype and balance_cents virtual attribute is Money type.

I think updating the existing field from accounts.balance to accounts.balance_cents would be a better option long-term. Otherwise, this could be confusing when adding new money-related fields in the future (that will use the _cents prefix).

@Shpigford
Copy link
Member

Ultimately we ideally store a single instance of the amount and its currency (really for any instance of money...balance, transaction, etc).

Then we can easily convert to other currencies as required for a given user's account.

@rmarescu
Copy link
Contributor

rmarescu commented Feb 4, 2024

Right, amounts.balance_cents (if renamed from accounts.balance) and accounts.currency would be the only DB table fields that store the balance information for a given account.
Account#balance attribute (which would be a Money object, not a DB table field) would be the interface to interact with those fields (for conversions, calculations, etc).

The suggestion is about renaming the DB table field to match the proper naming convention and avoid future confusion.

Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! Looks good overall, just a few semantic changes around field naming and I think we should be good!

app/models/account.rb Outdated Show resolved Hide resolved
Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@zachgoll zachgoll merged commit 1182ab3 into maybe-finance:main Feb 6, 2024
3 of 4 checks passed
@kiliczsh
Copy link
Contributor

kiliczsh commented Feb 6, 2024

This may have a migration problem, I just removed data account data and successfully run but if it is in production it may worth to take a look. @zachgoll

rails db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
== 20240206031739 ReplaceMoneyField: migrating ================================
-- add_column(:accounts, "balance_cents", :integer, {:null=>false, :default=>0})
   -> 0.0116s
-- add_column(:accounts, "balance_currency", :string, {:null=>false, :default=>"USD"})
   -> 0.0027s
-- change_column(:accounts, :balance_cents, :integer, {:limit=>8})
   -> 0.0237s
bin/rails aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)

'amount' must be numeric
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/money-6.16.0/lib/money/money.rb:308:in `from_amount'
/Users/kilic/Development/RailsApps/maybe/db/migrate/20240206031739_replace_money_field.rb:9:in `block in change'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:82:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:82:in `block in find_each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:158:in `block in find_in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:396:in `block in batch_on_unloaded_relation'
<internal:kernel>:187:in `loop'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:372:in `batch_on_unloaded_relation'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:269:in `in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:157:in `find_in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:81:in `find_each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/querying.rb:23:in `find_each'
/Users/kilic/Development/RailsApps/maybe/db/migrate/20240206031739_replace_money_field.rb:8:in `change'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:985:in `exec_migration'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:969:in `block (2 levels) in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:968:in `block in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `with_connection'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:967:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1177:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1528:in `block in execute_migration_in_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:536:in `block in within_new_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:533:in `within_new_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1579:in `ddl_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1527:in `execute_migration_in_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1502:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1502:in `migrate_without_lock'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1447:in `block in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1599:in `with_advisory_lock'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1447:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1273:in `up'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1248:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <main>'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `block in execute'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `execute'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `synchronize'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:188:in `invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:182:in `invoke_task'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block in top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:147:in `run_with_threads'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:132:in `top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208:in `standard_exception_handling'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59:in `with_application'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:156:in `invoke_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:73:in `block in invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:149:in `with_argv'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:69:in `invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands.rb:18:in `<main>'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'

Caused by:
ArgumentError: 'amount' must be numeric (ArgumentError)

    raise ArgumentError, "'amount' must be numeric" unless Numeric === amount
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/money-6.16.0/lib/money/money.rb:308:in `from_amount'
/Users/kilic/Development/RailsApps/maybe/db/migrate/20240206031739_replace_money_field.rb:9:in `block in change'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:82:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:82:in `block in find_each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:158:in `block in find_in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:396:in `block in batch_on_unloaded_relation'
<internal:kernel>:187:in `loop'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:372:in `batch_on_unloaded_relation'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:269:in `in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:157:in `find_in_batches'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/relation/batches.rb:81:in `find_each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/querying.rb:23:in `find_each'
/Users/kilic/Development/RailsApps/maybe/db/migrate/20240206031739_replace_money_field.rb:8:in `change'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:985:in `exec_migration'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:969:in `block (2 levels) in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/benchmark.rb:298:in `measure'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:968:in `block in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `with_connection'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:967:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1177:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1528:in `block in execute_migration_in_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:536:in `block in within_new_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb:533:in `within_new_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:344:in `transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1579:in `ddl_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1527:in `execute_migration_in_transaction'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1502:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1502:in `migrate_without_lock'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1447:in `block in migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1599:in `with_advisory_lock'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1447:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1273:in `up'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/migration.rb:1248:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/tasks/database_tasks.rb:243:in `migrate'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/activerecord/lib/active_record/railties/databases.rake:93:in `block (2 levels) in <main>'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `block in execute'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:281:in `execute'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `synchronize'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/task.rb:188:in `invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:182:in `invoke_task'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `each'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block in top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:147:in `run_with_threads'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:132:in `top_level'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:27:in `block (2 levels) in perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/application.rb:208:in `standard_exception_handling'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:27:in `block in perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:44:in `block in with_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_module.rb:59:in `with_application'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:41:in `with_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:156:in `invoke_rake'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:73:in `block in invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:149:in `with_argv'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/command.rb:69:in `invoke'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails-554e5c2d8e8d/railties/lib/rails/commands.rb:18:in `<main>'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
/Users/kilic/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate

@zachgoll
Copy link
Collaborator

zachgoll commented Feb 6, 2024

@kiliczsh thanks, will take a look!

@danielveloso09
Copy link
Contributor

@zachgoll has reviewed the problem and promptly opened a PR to address the migration issue.

While this action resolves the issue directly, I'm uncertain if it aligns with the project standard procedure. If you prefer to have first a formal issue to outline the problem before proceeding with the solution via a PR, please feel free to ping me and I'll accommodate accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate the money-rails gem
7 participants