Skip to content

Commit

Permalink
fix(survey): makes the ORM do the query correctly?
Browse files Browse the repository at this point in the history
  • Loading branch information
chillfox committed Feb 21, 2024
1 parent 689457e commit c8e7389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/placeos-models/survey/invitation.cr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module PlaceOS::Model
query = query.where(survey_id: survey_id) if survey_id
# can't use `query.where_not(sent: true)` here due to
# `sent <> true` not being equivalent to `sent IS NOT true` in PostgreSQL
query = sent ? query.where(sent: true) : query.where("sent IS NOT $1", true) unless sent.nil?
query = sent ? query.where(sent: true) : query.where("sent IS NOT true", nil) unless sent.nil?
query.to_a
end

Expand Down

0 comments on commit c8e7389

Please sign in to comment.