Class: Rollwire::Report
- Inherits:
-
Object
- Object
- Rollwire::Report
- Defined in:
- lib/rollwire/report.rb
Constant Summary collapse
- EVENT_NAME =
"ignored_rollback.rollwire"
Instance Attribute Summary collapse
-
#inner_location ⇒ Object
readonly
Returns the value of attribute inner_location.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#outer_location ⇒ Object
readonly
Returns the value of attribute outer_location.
-
#writes ⇒ Object
readonly
Returns the value of attribute writes.
Instance Method Summary collapse
-
#initialize(inner_location:, mode:, outer_location:, writes:) ⇒ Report
constructor
A new instance of Report.
- #to_s ⇒ Object
Constructor Details
#initialize(inner_location:, mode:, outer_location:, writes:) ⇒ Report
Returns a new instance of Report.
9 10 11 12 13 14 |
# File 'lib/rollwire/report.rb', line 9 def initialize(inner_location:, mode:, outer_location:, writes:) @inner_location = inner_location @mode = mode @outer_location = outer_location @writes = writes end |
Instance Attribute Details
#inner_location ⇒ Object (readonly)
Returns the value of attribute inner_location.
7 8 9 |
# File 'lib/rollwire/report.rb', line 7 def inner_location @inner_location end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
7 8 9 |
# File 'lib/rollwire/report.rb', line 7 def mode @mode end |
#outer_location ⇒ Object (readonly)
Returns the value of attribute outer_location.
7 8 9 |
# File 'lib/rollwire/report.rb', line 7 def outer_location @outer_location end |
#writes ⇒ Object (readonly)
Returns the value of attribute writes.
7 8 9 |
# File 'lib/rollwire/report.rb', line 7 def writes @writes end |
Instance Method Details
#to_s ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rollwire/report.rb', line 16 def to_s <<~REPORT.chomp Rollwire::IgnoredNestedRollback ActiveRecord::Rollback was raised inside a transaction that joined an existing transaction. #{write_consequence} Inner transaction: #{inner_location || '(unknown)'} Outer transaction: #{outer_location || '(not captured)'} Use `requires_new: true` to roll back only the inner block, or propagate the failure to the outer transaction. REPORT end |