Skip to content

Instantly share code, notes, and snippets.

@pkondzior
Created November 30, 2010 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkondzior/721595 to your computer and use it in GitHub Desktop.
Save pkondzior/721595 to your computer and use it in GitHub Desktop.
before_validation(:reject_bad_attributes)
def reject_bad_attributes
attributes_to_be_rejected = [:a, :b, :c]
self.attributes = self.attributes.reject { |key, value| attributes_to_be_rejcted.include?(key) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment