Guest User

Untitled

a guest
Aug 19th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. What is the shortest way in ruby to write these four instructions?
  2. u = User.email_equals("tabaluga@gmail.com").first
  3. s = u.setting
  4. s.regular_info = false
  5. s.save
  6.  
  7. User.email_equals("tabaluga@gmail.com").first.setting.update_attribute(:regular_info, false)
  8.  
  9. User.find_by_email("tabaluga@gmail.com").setting.update_attribute(:regular_info, false)
Add Comment
Please, Sign In to add comment