SHARE
TWEET

Untitled

a guest Feb 27th, 2012 20 Never
  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
RAW Paste Data
Top