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

Potentially prepend table name to order_within_rank column if none is supplied? #519

Open
nickjj opened this issue Oct 22, 2023 · 0 comments

Comments

@nickjj
Copy link

nickjj commented Oct 22, 2023

Hi,

Thanks a lot for making this extension, it's working great.

In one of my pg_search_scope calls I used order_within_rank: "updated_at DESC" and this works fine but I ended up joining this table in from another query and then ActiveRecord threw this error:

ActiveRecord::StatementInvalid (PG::AmbiguousColumn: ERROR:  column reference "updated_at" is ambiguous
LINE 1: ...ER BY pg_search_7dfb4cf67742cb0660305e.rank DESC, updated_at

Eventually I tracked it down and I had to use order_within_rank: "users.updated_at DESC" but I wonder if this could be done automatically if no table prefix is provided. This would allow it to work out of the box but also let you set something else if needed?

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

No branches or pull requests

1 participant