Skip to content

Instantly share code, notes, and snippets.

@alexvbush
Last active May 24, 2018 07:45
Show Gist options
  • Save alexvbush/d092d45705909da60cec to your computer and use it in GitHub Desktop.
Save alexvbush/d092d45705909da60cec to your computer and use it in GitHub Desktop.
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