75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/dm-sanitizer.rb', line 75
def sanitize!
options = self.class.sanitization_options
return false if options[:disabled]
self.class.properties.each do |property|
property_name = property.name.to_sym
next unless options[:property_types].include?(property.class)
next if !new? && !options[:with_dirty] && !attribute_dirty?(property.name.to_sym)
next if options[:exclude] && options[:exclude].include?(property_name)
property_mode = options[:modes] ? options[:modes][property_name] || options[:default_mode] : options[:default_mode]
sanitize_property!(property_name, property_mode)
end
return true
end
|