Sha256: 5e9faaa47f8684892b59cc751558fa1a17ba2497d43f6ea1dff8d23570b58611
Contents?: true
Size: 380 Bytes
Versions: 8
Compression:
Stored size: 380 Bytes
Contents
module AttributesNormalizer extend ActiveSupport::Concern included do before_save :normalize_attributes end def excluded_normalized_attrs [] end 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 end
Version data entries
8 entries across 8 versions & 1 rubygems