Module: AttributesNormalizer

Extended by:
ActiveSupport::Concern
Included in:
CgAppBase::Address, CgAppBase::Contact, CgAppBase::Phone
Defined in:
app/models/concerns/attributes_normalizer.rb

Instance Method Summary collapse

Instance Method Details

#excluded_normalized_attrsObject



8
9
10
# File 'app/models/concerns/attributes_normalizer.rb', line 8

def excluded_normalized_attrs
  []
end

#normalize_attributesObject



12
13
14
15
16
17
18
# File 'app/models/concerns/attributes_normalizer.rb', line 12

def normalize_attributes
  self.attributes.each do |k, v|
    unless excluded_normalized_attrs.include?(k.to_sym) || !v.is_a?(String)
      self.send("#{k}=", v.mb_chars.upcase)
    end
  end
end