Method: EPlat::Metafield#normalize_attributes

Defined in:
lib/e_plat/resource/metafield.rb

#normalize_attributesObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/e_plat/resource/metafield.rb', line 34

def normalize_attributes
    attributes.each {|k,v| attribute_will_change!(k) if READ_ONLY_ATTRIBUTES.exclude?(k.to_sym) }

    return unless client.bigcommerce?

    if permission_set.nil?
        self.permission_set = BIGCOMMERCE_DEFAULT_PERMISSION_SET 
    end

    if value?
        self.value = value.to_s
        self.value = "" if value == "false"
    end
end