Skip to content

Commit

Permalink
saved searches only with user's feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
jlgeering committed Apr 1, 2012
1 parent 928932b commit 258829c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/saved_search.rb
Expand Up @@ -2,12 +2,12 @@ class SavedSearch < ActiveRecord::Base
belongs_to :user

def articles
search_params = {:query => query, :after => last_access}
search_params = {:query => query, :after => last_access, :feeds => user.feeds.collect { |item| item.id }}
Article.search(search_params)
end

def count
search_params = {:query => query, :after => last_access}
search_params = {:query => query, :after => last_access, :feeds => user.feeds.collect { |item| item.id }}
Article.count(search_params)
end

Expand Down
1 change: 1 addition & 0 deletions app/views/channels/index.html.erb
Expand Up @@ -11,6 +11,7 @@
<td>(<%= channel.count %>)</td>
<td><%= link_to channel.query, channel_path(channel) %></td>
<td>we could also list facets here, i.e. how many news per feed</td>
<td><%= link_to 'edit saved search', edit_saved_search_path(channel) %></td>
</tr>
<% end %>
</table>
Expand Down

0 comments on commit 258829c

Please sign in to comment.