Skip to content

Commit

Permalink
Moves options in Sanitiziable::Marco
Browse files Browse the repository at this point in the history
Moves options validation to method head in Sanitiziable::Marco#skip_sanitization_of
  • Loading branch information
tlux committed May 7, 2014
1 parent a7555e9 commit dc53dc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sanitizable/macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def acts_as_sanitizable_on(*attribute_names, &block)
end

def skip_sanitization_of(*attribute_names)
options = attribute_names.extract_options!.assert_valid_keys(:on)
if self.include?(Model)
options = attribute_names.extract_options!.assert_valid_keys(:on)
attribute_names = attribute_names.map(&:to_s)
context = options[:on]
sanitizable_attributes.delete_if do |attribute|
Expand Down

0 comments on commit dc53dc5

Please sign in to comment.