Class: ActiveRecord::RecordInvalid
- Inherits:
-
ActiveRecordError
- Object
- ActiveRecordError
- ActiveRecord::RecordInvalid
- Includes:
- GetText
- Defined in:
- lib/gettext/active_record.rb
Overview
:nodoc:
Constant Summary
Constants included from GetText
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record) ⇒ RecordInvalid
constructor
A new instance of RecordInvalid.
Methods included from GetText
N_, #Nn_, _, #add_default_locale_path, bindtextdomain, #bindtextdomain_to, bound_target, bound_targets, cached=, cached?, cgi, cgi=, clear_cache, create_mofiles, current_textdomain_info, each_textdomain, find_targets, gettext, included, locale, locale=, msgmerge, msgmerge_all, n_, ngettext, ns_, nsgettext, output_charset, output_charset=, rgettext, rmsgfmt, rmsgmerge, s_, set_cgi, set_locale, set_locale_all, set_output_charset, setlocale, sgettext, textdomain, #textdomain_to, update_pofiles
Constructor Details
#initialize(record) ⇒ RecordInvalid
Returns a new instance of RecordInvalid.
26 27 28 29 30 |
# File 'lib/gettext/active_record.rb', line 26 def initialize(record) @record = record super(_("Validation failed: %{error_messages}") % {:error_messages => @record.errors..join(", ")}) end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
22 23 24 |
# File 'lib/gettext/active_record.rb', line 22 def record @record end |