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
Added transaction verbosity for activerecord #65
Added transaction verbosity for activerecord #65
Conversation
I believe this option is for the upcoming Rails 4.2 release. |
@joevandyk yap, this is for rails 4.2 ... we already use it. And #64 is the real pain for us ... |
@joevandyk I could add new Gemfile for 4.2 and set this options only if Rails version >= 4.2 |
In Rails.4.1.6 it swallows exceptions by default def rollback_records
@state.set_state(:rolledback)
records.uniq.each do |record|
begin
record.rolledback!(parent.closed?)
rescue => e
record.logger.error(e) if record.respond_to?(:logger) && record.logger
end
end
end |
@chanks I just try to say – you passed spec is not true. Because exception is swallowed by I added ActiveRecord version check in spec. Please 👀 |
5b27f11
to
7cd24ce
Compare
I can confirm that when using Rails master and adding this to the spec:
results in this error:
|
@joevandyk The main problem is that AR swallow real exception and the spec is passed |
@Strech Yes, that makes sense now. Thanks for your time on this! |
Make spec from c1f32f6 fail
As you can see here https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/transaction.rb#L75
AR by default swallows exception. But in rails app, this attribute set to true.
After you merge this request, you will find #64 very helpful