Module: ActsAsHtmlSanitized::ModelExtensions::ClassMethods
- Defined in:
- lib/acts_as_html_sanitized/model_extensions.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_html_sanitized ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/acts_as_html_sanitized/model_extensions.rb', line 11 def acts_as_html_sanitized before_validation do |record| for column in record.class.content_columns if column.type == :string || column.type == :text unless record[column.name].nil? record[column.name] = Sanitize.clean(record[column.name]) end end end end end |