Skip to content

Commit

Permalink
Avoid "PG::AmbiguousColumn: ERROR: column reference "confirmed_at" is…
Browse files Browse the repository at this point in the history
… ambiguous"

Proposal.joins(speakers: :user).confirmed
 => ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR:  column reference "confirmed_at" is ambiguous)
  • Loading branch information
amatsuda committed Dec 2, 2024
1 parent 5acc5a4 commit 1979127
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Proposal < ApplicationRecord
scope :accepted, -> { where(state: ACCEPTED) }
scope :waitlisted, -> { where(state: WAITLISTED) }
scope :submitted, -> { where(state: SUBMITTED) }
scope :confirmed, -> { where('confirmed_at IS NOT NULL') }
scope :confirmed, -> { where.not(confirmed_at: nil) }

scope :soft_accepted, -> { where(state: SOFT_ACCEPTED) }
scope :soft_waitlisted, -> { where(state: SOFT_WAITLISTED) }
Expand Down

0 comments on commit 1979127

Please sign in to comment.