We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I think we may get incorrect mapping of column names when using multiple joins, eg. executing following query:
SELECT sample.* FROM sample INNER JOIN joins ON joins.event_name = sample.event_name INNER JOIN secondary_joins ON secondary_joins.event_name = sample.event_name LIMIT 1
#<Model:0x0000000108103318>
with attributes:
{"sample.event_name"=>"some event 1", "sample.event_value"=>nil, "sample.enabled"=>false, "sample.date"=>Thu, 01 Jan 1970, "sample.datetime"=>1970-01-01 00:00:00 UTC, "sample.datetime64"=>nil, "sample.relation_uuid"=>nil, "sample.id"=>1}
accessing id of returned record throws an error:
id
> model.id ActiveModel::MissingAttributeError: missing attribute 'id' for Model
#<Model:0x000000010a6fb070 event_name: "some event 1", event_value: nil, enabled: false, date: Thu, 01 Jan 1970, datetime: 1970-01-01 00:00:00 UTC, datetime64: nil, relation_uuid: nil, id: 1>
{"event_name"=>"some event 1", "event_value"=>nil, "enabled"=>false, "date"=>Thu, 01 Jan 1970, "datetime"=>1970-01-01 00:00:00 UTC, "datetime64"=>nil, "relation_uuid"=>nil, "id"=>1}
so id and other attrs should be accessible:
> model.id => 1
The text was updated successfully, but these errors were encountered:
@PNixx can you roughly tell why is PR #113 now closed? Is the current behavior desirable? Thanks in advance for few words of explanation.
Sorry, something went wrong.
No branches or pull requests
Hello,
I think we may get incorrect mapping of column names when using multiple joins, eg. executing following query:
As a result we have:
with attributes:
accessing
id
of returned record throws an error:In valid scenario, we should get following result:
with attributes:
so
id
and other attrs should be accessible:The text was updated successfully, but these errors were encountered: