Class: ActiveRecord::RecordInvalid

Inherits:
ActiveRecordError
  • Object
show all
Includes:
GetText
Defined in:
lib/gettext_activerecord/validations.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GetText

#update_pofiles, #update_pofiles_org

Constructor Details

#initialize(record) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



16
17
18
19
20
# File 'lib/gettext_activerecord/validations.rb', line 16

def initialize(record)
  @record = record
  super(_("Validation failed: %{error_messages}") % 
        {:error_messages => @record.errors.full_messages.join(", ")})
end

Instance Attribute Details

#recordObject (readonly)

:nodoc:



12
13
14
# File 'lib/gettext_activerecord/validations.rb', line 12

def record
  @record
end