Guest User

Untitled

a guest
May 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. class ViewModel
  2. before_save :to_upper
  3.  
  4. #...
  5.  
  6. private
  7. def to_upper
  8. attributes.keys.each do |attribute|
  9. self[attribute].try(:upcase!)
  10. end
  11. end
  12. end
Add Comment
Please, Sign In to add comment