Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer Arel based AR DSL over SQL string in scopes #411

Merged

Conversation

amatsuda
Copy link
Collaborator

@amatsuda amatsuda commented Dec 2, 2024

Or this scope causes "PG::AmbiguousColumn: ERROR: column reference "confirmed_at" is ambiguous" when joined with another table that has confirmed_at column.

Example

Proposal.joins(speakers: :user).confirmed
=> ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR: column reference "confirmed_at" is ambiguous)

… ambiguous"

Proposal.joins(speakers: :user).confirmed
 => ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR:  column reference "confirmed_at" is ambiguous)
@amatsuda amatsuda merged commit 1979127 into rubycentral:main Dec 2, 2024
1 check passed
@amatsuda amatsuda deleted the ambiguous_proposal_confirmed_scope branch December 2, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant