77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# File 'lib/dm-sanitizer.rb', line 77
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 property.type == String || property.type == DataMapper::Types::Text
next if !new_record? && !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
|