Exception: SimpleRecord::RecordNotSaved

Inherits:
SimpleRecordError show all
Defined in:
lib/simple_record/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record = nil) ⇒ RecordNotSaved

Returns a new instance of RecordNotSaved.



11
12
13
14
# File 'lib/simple_record/errors.rb', line 11

def initialize(record=nil)
    @record = record
    super("Validation failed: #{@record.errors.full_messages.join(", ")}")
end

Instance Attribute Details

#recordObject

Returns the value of attribute record.



9
10
11
# File 'lib/simple_record/errors.rb', line 9

def record
  @record
end