app/controllers/api_controller/normalizer.rb
#
# Let's normalize the attribute based on its name
#
Let's normalize the attribute based on its name
Let ' s normalize the attribute based on its name
def normalize_attr_byname(type, attr, value)
      return if value.nil?
      if self.class.attr_type_hash(:time).key?(attr.to_s)
        normalize_attr(type, :time, value)
      elsif self.class.attr_type_hash(:url).key?(attr.to_s)
        normalize_attr(type, :url,  value)
      elsif self.class.attr_type_hash(:encrypted).key?(attr.to_s) || attr.to_s.include?("password")
        normalize_attr(type, :encrypted,  value)
      elsif self.class.attr_type_hash(:resource).key?(attr.to_s)
        normalize_attr(type, :resource, value)
      else
        value
      end
    end
def normalize_attr_byname ( type , attr , value ) return if value . nil? if self . class . attr_type_hash ( :time ) . key? ( attr . to_s ) normalize_attr ( type , :time , value ) elsif self . class . attr_type_hash ( :url ) . key? ( attr . to_s ) normalize_attr ( type , :url , value ) elsif self . class . attr_type_hash ( :encrypted ) . key? ( attr . to_s ) || attr . to_s . include? ( "password" ) normalize_attr ( type , :encrypted , value ) elsif self . class . attr_type_hash ( :resource ) . key? ( attr . to_s ) normalize_attr ( type , :resource , value ) else value end end
Let's normalize the attribute based on its name
Let ' s normalize the attribute based on its name
type
<not_specific>
attr
<not_specific>
value
<not_specific>