Skip to content

Commit

Permalink
fix: Repo.all()
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Feb 4, 2024
1 parent 5b81de7 commit 40eeb99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/safira/accounts/accounts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,7 @@ defmodule Safira.Accounts do
)
|> Enum.map(fn x -> x.attendee end)
else
Repo.all(
from r in Redeem,
join: a in assoc(r, :attendee),
preload: [attendee: a]
)
|> Enum.map(fn x -> x.attendee end)
Repo.all(Attendee)
end
end

Expand Down
10 changes: 9 additions & 1 deletion test/safira_web/controllers/cv_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ defmodule SafiraWeb.CVControllerTest do

user_company = create_user_strategy(:user)
user_company_no_access = create_user_strategy(:user)
company = insert(:company, user: user_company, badge: badge, has_cv_access: true)

company =
insert(:company,
user: user_company,
badge: badge,
has_cv_access: true,
sponsorship: "Bronze"
)

company_no_access = insert(:company, user: user_company_no_access, has_cv_access: false)

user_attendee_with_badge = create_user_strategy(:user)
Expand Down

0 comments on commit 40eeb99

Please sign in to comment.