Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Use delegate method
- post.user.username -> post.username
- class Post
- delegate :username, to: :user # where user table has username field
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement