Skip to content

Commit

Permalink
Exclude hello world from inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kytrinyx committed Sep 5, 2015
1 parent 8531481 commit 608e9b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/exercism/inbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def viewed_sql(ids)
AND views.last_viewed_at > ex.last_activity_at
AND ex.archived='f'
AND ex.language='#{track_id}'
AND ex.slug != 'hello-world'
AND ex.id IN ('#{ids.join("','")}')
SQL
end
Expand All @@ -116,6 +117,7 @@ def exercises_sql
WHERE acls.user_id=#{user.id}
AND ex.language='#{track_id}'
AND ex.archived='f'
AND ex.slug != 'hello-world'
ORDER BY ex.last_activity_at DESC
LIMIT #{per_page} OFFSET #{offset}
SQL
Expand Down
2 changes: 2 additions & 0 deletions lib/exercism/user_track_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def exercise_counts_per_track_sql(user_id)
AND ex.slug=acls.slug
WHERE acls.user_id=#{user_id}
AND ex.archived='f'
AND ex.slug != 'hello-world'
GROUP BY ex.language
SQL
end
Expand All @@ -40,6 +41,7 @@ def viewed_counts_per_track_sql(user_id)
WHERE views.user_id=#{user_id}
AND views.last_viewed_at > ex.last_activity_at
AND ex.archived='f'
AND ex.slug != 'hello-world'
GROUP BY ex.language
SQL
end
Expand Down
1 change: 1 addition & 0 deletions test/exercism/inbox_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_inbox
{user: bob, language: 'elixir', slug: 'triangle', archived: false, auth: true, viewed: -1},
{user: bob, language: 'elixir', slug: 'anagram', archived: false, auth: true, viewed: -1},
{user: bob, language: 'elixir', slug: 'word-count', archived: false, auth: true, viewed: +1},
{user: bob, language: 'go', slug: 'hello-world', archived: false, auth: true, viewed: -1},
{user: bob, language: 'go', slug: 'leap', archived: false, auth: true, viewed: +1},
{user: bob, language: 'go', slug: 'clock', archived: false, auth: false, viewed: -1},
{user: alice, language: 'go', slug: 'leap', archived: true, auth: true, viewed: +1},
Expand Down
1 change: 1 addition & 0 deletions test/exercism/user_track_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_user_tracks
{user: bob, language: 'go', slug: 'clock', archived: false, auth: false, viewed: -1},
{user: bob, language: 'go', slug: 'hamming', archived: true, auth: true, viewed: -1},
{user: bob, language: 'elixir', slug: 'triangle', archived: false, auth: true, viewed: -1},
{user: bob, language: 'go', slug: 'hello-world', archived: false, auth: true, viewed: -1},
].each do |exercise|
ts = Time.now.utc
auth = exercise.delete(:auth)
Expand Down

0 comments on commit 608e9b3

Please sign in to comment.