Exception: ActiveRecord::SnapshotView::SaveWork

Inherits:
Exception
  • Object
show all
Defined in:
lib/activerecord_snapshot_view/snapshot_view.rb

Overview

if a block given to the new_version method throws this exception, then the working table will still be made current

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cause = nil) ⇒ SaveWork

Returns a new instance of SaveWork.



73
74
75
# File 'lib/activerecord_snapshot_view/snapshot_view.rb', line 73

def initialize(cause=nil)
  @cause = cause
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



72
73
74
# File 'lib/activerecord_snapshot_view/snapshot_view.rb', line 72

def cause
  @cause
end

Instance Method Details

#backtraceObject



81
82
83
# File 'lib/activerecord_snapshot_view/snapshot_view.rb', line 81

def backtrace
  (@cause.backtrace if @cause) || super
end

#messageObject



77
78
79
# File 'lib/activerecord_snapshot_view/snapshot_view.rb', line 77

def message
  (@cause.message if @cause) || "SaveWork"
end