diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 588bf5c5..34fafe27 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -20,7 +20,7 @@ def resolve .where('private is not true') .joins(:boards) .order(launched_row_order: :desc) - .uniq + .distinct end end end diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index 8593661c..82cb7f81 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -19,6 +19,7 @@ context 'with scope' do let!(:launched1){ create :project, launched_row_order: 1 } let!(:board1){ create :board, section: "project-#{ launched1.id }" } + let!(:second_board_of_launched1){ create :board, section: "project-#{ launched1.id }" } let!(:launched2){ create :project, launched_row_order: 2 } let!(:board2){ create :board, section: "project-#{ launched2.id }" }