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

avoid select(all_fields) in any tag query to fix error when use as subquery #1049

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kikyous
Copy link

@kikyous kikyous commented Sep 30, 2021

No description provided.

@kikyous
Copy link
Author

kikyous commented May 24, 2022

@enomotodev @donquxiote someone can review this pr?

@donquxiote
Copy link
Contributor

@kikyous I'm not a maintainer, you probably want @seuros

@seuros
Copy link
Collaborator

seuros commented May 24, 2022

@kikyous the PR look fine, but can you add a test case ?

@kikyous
Copy link
Author

kikyous commented May 25, 2022

@kikyous the PR look fine, but can you add a test case ?

ok, I will try to add a test case.

@kikyous
Copy link
Author

kikyous commented May 25, 2022

@seuros test case added

@kikyous
Copy link
Author

kikyous commented Jul 21, 2022

@seuros ping

@andyundso
Copy link

In the meantime, if any one stumbles upon this, you can remove the select from the query that the gem adds with unscope.

class Stuff < ApplicationRecord
  acts_as_taggable

  has_many :things
end

class Thing < ApplicationRecord
  belongs_to :stuff
end

Thing.where(stuff: Stuff.tagged_with(["foo", "bar"], any: true).unscope(:select))

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.

4 participants