Exception: GroongaClientModel::RecordInvalid

Inherits:
Error
  • Object
show all
Defined in:
lib/groonga_client_model/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



36
37
38
39
40
41
42
43
44
# File 'lib/groonga_client_model/error.rb', line 36

def initialize(record)
  @record = record
  errors = @record.errors.full_messages.join(", ")
  i18n_scope = @record.class.i18n_scope
  message = I18n.t(:"#{i18n_scope}.errors.messages.record_invalid",
                   errors: errors,
                   default: :"errors.messages.record_invalid")
  super(message)
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



34
35
36
# File 'lib/groonga_client_model/error.rb', line 34

def record
  @record
end