Class: ActiveRecord::RecordInvalid

Inherits:
ActiveRecordError
  • Object
show all
Includes:
GetText
Defined in:
lib/gettext/active_record.rb

Overview

:nodoc:

Constant Summary

Constants included from GetText

GetText::CACHE_BOUND_TARGET_MAX_SIZE, GetText::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

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, #npgettext, ns_, nsgettext, output_charset, output_charset=, p_, pgettext, remove_all_textdomains, 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.full_messages.join(", ")})
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



22
23
24
# File 'lib/gettext/active_record.rb', line 22

def record
  @record
end