Skip to content

Commit

Permalink
replace deprecated .uniq with .distinct , update test with a secondar…
Browse files Browse the repository at this point in the history
…y board of launched project to ensure distinct projects come out of query result
  • Loading branch information
yuenmichelle1 committed Aug 8, 2024
1 parent b32fed1 commit a23ee99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/policies/project_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def resolve
.where('private is not true')
.joins(:boards)
.order(launched_row_order: :desc)
.uniq
.distinct
end
end
end
1 change: 1 addition & 0 deletions spec/policies/project_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }" }
Expand Down

0 comments on commit a23ee99

Please sign in to comment.