def read_attribute_for_validation(attr)
      attribute = database_field_name(attr)
      if relations.key?(attribute)
        begin_validate
        relation = without_autobuild { send(attr) }
        exit_validate
        relation.do_or_do_not(:in_memory) || relation
      elsif fields[attribute].try(:localized?)
        attributes[attribute]
      else
        send(attr)
      end
    end
def read_attribute_for_validation(attr)
      attribute = database_field_name(attr)
      if relations.key?(attribute)
        begin_validate
        relation = without_autobuild { send(attr) }
        exit_validate
        relation.do_or_do_not(:in_memory) || relation
      elsif fields[attribute].try(:localized?)
        attributes[attribute]
      else
        send(attr)
      end
    end
Overrides the default ActiveModel behavior since we need to handle
 validations of associations slightly different than just calling the
 getter.

 @example Read the value.
   person.read_attribute_for_validation(:addresses)

 @param [ Symbol ] attr The name of the field or association.

 @return [ Object ] The value of the field or the association.

 @since 2.0.0.rc.1