Guest User

Untitled

a guest
Feb 27th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. module StripAttributes
  2. def strip_attributes!(*attrs)
  3. attrs.map(&:to_s)
  4. before_validation do |r|
  5. attrs.each do |v|
  6. r[v].strip! if r[v]
  7. end
  8. end
  9. end
  10. end
Add Comment
Please, Sign In to add comment