diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-02-10 17:04:52 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-02-10 17:04:52 +0400 |
commit | 56f989e53e80fe7545a3400ba7ee98a0cd2cf259 (patch) | |
tree | e43d7b724b373969ce0dfa9a59c1c447352f8d95 /app/services | |
parent | 5a098e84e4de30d95ba5e0a3a7bbd81813cf3305 (diff) |
Fix wrong issues appears at Dashboard#issues page
Filtering service used klass instead of passed items.
Because of this you see list of all issues intead of authorized ones.
This commit fixes it so people see only issues they are authorized to
see.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/filtering_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/filtering_service.rb b/app/services/filtering_service.rb index ebd394ee758..52537f7ba4f 100644 --- a/app/services/filtering_service.rb +++ b/app/services/filtering_service.rb @@ -57,11 +57,11 @@ class FilteringService def by_scope(items) case params[:scope] when 'created-by-me', 'authored' then - klass.where(author_id: current_user.id) + items.where(author_id: current_user.id) when 'all' then - klass + items when 'assigned-to-me' then - klass.where(assignee_id: current_user.id) + items.where(assignee_id: current_user.id) else raise 'You must specify default scope' end |