Guest User

Untitled

a guest
Jan 15th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. class Deal < ActiveRecord::Base
  2.  
  3. def full_name
  4. [first_name , last_name].join
  5. end
  6.  
  7. def full_name=(name)
  8. split = name.split(' ', 2)
  9. self.first_name = split.first
  10. self.last_name = split.last
  11. end
  12.  
  13. end
Add Comment
Please, Sign In to add comment