Exception: ActiveRemote::RemoteRecordNotSaved

Inherits:
ActiveRemoteError show all
Defined in:
lib/active_remote/errors.rb

Overview

Raised by ActiveRemove::Base.save! and ActiveRemote::Base.create! methods when remote record cannot be saved because it is invalid.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_or_record = nil) ⇒ RemoteRecordNotSaved

Returns a new instance of RemoteRecordNotSaved.



48
49
50
51
52
53
54
55
# File 'lib/active_remote/errors.rb', line 48

def initialize(message_or_record = nil)
  message = message_or_record
  if message_or_record.is_a?(::ActiveRemote::Base)
    @record = message_or_record
    message = @record.errors.full_messages.join(", ")
  end
  super(message)
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



46
47
48
# File 'lib/active_remote/errors.rb', line 46

def record
  @record
end