Exception: Cardiac::RecordInvalid
- Inherits:
-
ResourceError
- Object
- StandardError
- ResourceError
- Cardiac::RecordInvalid
- Defined in:
- lib/cardiac/errors.rb
Overview
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(record) ⇒ RecordInvalid
constructor
:nodoc:.
Constructor Details
#initialize(record) ⇒ RecordInvalid
:nodoc:
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/cardiac/errors.rb', line 34 def initialize(record) # :nodoc: @record = record errors = @record.errors..join(", ") remote_errors = @record.remote_errors..join(", ") if remote_errors.present? remote_errors = "(previous remote operation) #{remote_errors}" errors += ' ' if errors.present? end super I18n.t(:"#{@record.class.i18n_scope}.errors.messages.record_invalid", errors: errors, remote_errors: remote_errors, default: :"errors.messages.record_invalid") end |
Instance Attribute Details
#record ⇒ Object (readonly)
:nodoc:
33 34 35 |
# File 'lib/cardiac/errors.rb', line 33 def record @record end |