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

ActiveRecord deprecation #187

Open
saiqulhaq opened this issue Jun 13, 2020 · 6 comments
Open

ActiveRecord deprecation #187

saiqulhaq opened this issue Jun 13, 2020 · 6 comments

Comments

@saiqulhaq
Copy link

I got this deprecation warning when executed DoubleEntry::Validation::LineCheck.perform!

DEPRECATION WARNING: Using `return`, `break` or `throw` to exit a transaction block is
deprecated without replacement. If the `throw` came from
`Timeout.timeout(duration)`, pass an exception class as a second
argument so it doesn't use `throw` to abort its block. This results
in the transaction being committed, but in the next release of Rails
it will raise and rollback.
 (called from restartable_transaction at lib/ruby/gems/2.5.0/bundler/gems/double_entry-4ee0d7f9707a/lib/active_record/locking_extensions.rb:10)

I use newest rails

@swrobel
Copy link
Contributor

swrobel commented Jun 19, 2020

What version of DoubleEntry? Have you tried master?

Edit: confirmed this occurs on master based on the commit hash referenced in the backtrace.

@swrobel
Copy link
Contributor

swrobel commented Jun 29, 2020

@saiqulhaq could you post the full backtrace, if available, or better yet, a reproducible test case?

@saiqulhaq
Copy link
Author

this is the git commit ID 4ee0d7f

this is the file lib/active_record/locking_extensions.rb:10

I use rails master

@saiqulhaq
Copy link
Author

I will post the full backtrace tonight

@swrobel
Copy link
Contributor

swrobel commented Jul 15, 2020

@saiqulhaq ping!

@saiqulhaq
Copy link
Author

Sorry @swrobel for late response
this is the rails console output

DEPRECATION WARNING: Using `return`, `break` or `throw` to exit a transaction block is
deprecated without replacement. If the `throw` came from
`Timeout.timeout(duration)`, pass an exception class as a second
argument so it doesn't use `throw` to abort its block. This results
in the transaction being committed, but in the next release of Rails
it will raise and rollback.
 (called from restartable_transaction at ~/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/bundler/gems/double_entry-4ee0d7f9707a/lib/active_record/locking_extensions.rb:10)
  TRANSACTION (0.5ms)  COMMIT
  TRANSACTION (0.1ms)  BEGIN
  DoubleEntry::Validation::LineCheck Create (8.3ms)  INSERT INTO "double_entry_line_checks" ("last_line_id", "errors_found", "log", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["last_line_id"
, 30], ["errors_found", false], ["log", ""], ["created_at", "2020-10-01 15:27:16.537799"], ["updated_at", "2020-10-01 15:27:16.537799"]]
  TRANSACTION (0.7ms)  COMMIT
=> #<DoubleEntry::Validation::LineCheck:0x00007fd8f071d830
 id: 1,
 last_line_id: 30,
 errors_found: false,
 log: "",
 created_at: Thu, 01 Oct 2020 15:27:16.537799000 UTC +00:00,
 updated_at: Thu, 01 Oct 2020 15:27:16.537799000 UTC +00:00>
[2] pry(main)>

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

No branches or pull requests

2 participants