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.

Revisions

  1. alexvbush revised this gist Jul 26, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion for_socpe.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    def for_scope(scope, user = GuestUser.new)
    case scope
    when 'saved'

    user.saved_articles.scoped
    when 'my'
    user.tagged_articles.scoped
  2. alexvbush revised this gist Jul 26, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions for_socpe.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    def for_scope(scope, user = GuestUser.new)
    case scope
    when 'saved'

    user.saved_articles.scoped
    when 'my'
    user.tagged_articles.scoped
  3. alexvbush revised this gist Jul 26, 2014. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions for_socpe.rb
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    def for_scope(scope, user = GuestUser.new)
    case scope
    when 'saved'
    when 'saved'
    user.saved_articles.scoped
    when 'my'
    user.tagged_articles.scoped
    else
    scoped
    end
    when 'my'
    user.tagged_articles.scoped
    else
    scoped
    end
    end


  4. alexvbush renamed this gist Jul 26, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. alexvbush revised this gist Jul 21, 2014. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions for_socpe
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,13 @@ def for_scope(scope, user = GuestUser.new)
    else
    scoped
    end
    end


    # ????????? scoped or none or something else?

    class Guest
    def saved_articles
    Article.scoped
    end
    end
  6. alexvbush created this gist Jul 21, 2014.
    10 changes: 10 additions & 0 deletions for_socpe
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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