Class: MultipleTableInheritance::Child::Sanitizer
- Inherits:
-
Object
- Object
- MultipleTableInheritance::Child::Sanitizer
- Defined in:
- lib/multiple_table_inheritance/child/sanitizer.rb
Instance Method Summary collapse
-
#initialize(target, role) ⇒ Sanitizer
constructor
A new instance of Sanitizer.
- #sanitize(attributes) ⇒ Object
Constructor Details
#initialize(target, role) ⇒ Sanitizer
Returns a new instance of Sanitizer.
4 5 6 7 |
# File 'lib/multiple_table_inheritance/child/sanitizer.rb', line 4 def initialize(target, role) @target = target @role = role end |
Instance Method Details
#sanitize(attributes) ⇒ Object
9 10 11 12 13 |
# File 'lib/multiple_table_inheritance/child/sanitizer.rb', line 9 def sanitize(attributes) sanitized_attributes = attributes.reject { |key, value| deny?(key) } debug_protected_attribute_removal(attributes, sanitized_attributes) sanitized_attributes end |