Last active
August 29, 2015 13:57
-
-
Save jsuchal/9628024 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 link_to_notifiable(notifiable) | |
notifiable.link_to_notifiable(self) | |
end | |
# concerns/notifiable_presenters.rb | |
class Answer | |
def link_to_notifiable(helper) | |
helper.link_to_answer, question | |
end | |
end | |
class Comment | |
def link_to_notifiable(helper) | |
helper.link_to_comment, to_question | |
end | |
end | |
class Favorite | |
def link_to_notifiable(helper) | |
helper.link_to_question, question | |
end | |
end | |
class Question | |
def link_to_notifiable(helper) | |
helper.link_to_question, self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment