Exception: ActiveRecord::Bixformer::AttributeError
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveRecord::Bixformer::AttributeError
- Defined in:
- lib/activerecord-bixformer/error.rb
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(attribute, value, type = :invalid, options = {}) ⇒ AttributeError
constructor
A new instance of AttributeError.
Constructor Details
#initialize(attribute, value, type = :invalid, options = {}) ⇒ AttributeError
Returns a new instance of AttributeError.
24 25 26 27 28 |
# File 'lib/activerecord-bixformer/error.rb', line 24 def initialize(attribute, value, type = :invalid, = {}) @attribute = attribute.model.translate(attribute.name) super((attribute, type, value, )) end |
Instance Method Details
#full_message ⇒ Object
30 31 32 |
# File 'lib/activerecord-bixformer/error.rb', line 30 def I18n.t(:"errors.format", default: "%{attribute} %{message}", attribute: @attribute, message: ) end |