Last active
May 24, 2018 07:45
-
-
Save alexvbush/d092d45705909da60cec to your computer and use it in GitHub Desktop.
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 for_scope(scope, user = GuestUser.new) | |
case scope | |
when 'saved' | |
user.saved_articles.scoped | |
when 'my' | |
user.tagged_articles.scoped | |
else | |
scoped | |
end | |
end | |
# ????????? scoped or none or something else? | |
class Guest | |
def saved_articles | |
Article.scoped | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment