Module: ObjectAttorney::Errors::ClassMethods

Defined in:
lib/object_attorney/errors.rb

Overview

ActiveModel::Errors told me to declare the following methods for a minimal implementation

Instance Method Summary collapse

Instance Method Details

#human_attribute_name(attribute, _ = {}) ⇒ Object



8
9
10
# File 'lib/object_attorney/errors.rb', line 8

def human_attribute_name(attribute, _ = {})
  attribute
end

#i18n_scopeObject

Necessary for proper translations



18
19
20
# File 'lib/object_attorney/errors.rb', line 18

def i18n_scope
  :activemodel
end

#lookup_ancestorsObject

Necessary for proper translations



13
14
15
# File 'lib/object_attorney/errors.rb', line 13

def lookup_ancestors
  [self]
end