Exception: Statecraft::UnsavedRecordError

Inherits:
Error
  • Object
show all
Defined in:
lib/statecraft/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record:) ⇒ UnsavedRecordError

Returns a new instance of UnsavedRecordError.



74
75
76
77
78
# File 'lib/statecraft/errors.rb', line 74

def initialize(record:)
  @record = record
  super("cannot transition an unsaved #{record.class.name}: save the record first; " \
        "initial state comes from the column default")
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



72
73
74
# File 'lib/statecraft/errors.rb', line 72

def record
  @record
end