Created
October 21, 2014 13:39
-
-
Save matstc/9d3f2cffae739c59140a to your computer and use it in GitHub Desktop.
Example of varying levels of abstraction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def favorite post | |
post.favorites.create!(user: current_user) | |
if post.user.email_settings.email_favorites? | |
UserMailer.favorite_email('Your post was favorited!', | |
"Good job! Your post was favorited. | |
#{link_to post_path(post), 'Have a look for yourself'}. \ | |
Your friendly social networking team.").deliver | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment