8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I have an association where I use a text string for my primary key.
has_many :children, class_name: "ActsAsTaggableOn::Tag", foreign_key: :parent_name, primary_key: :name, dependent: :nullify define_eager_group :children_count, :children, :count, :*
when I do eager_group count, it is associating with the object's id instead of the association's PK (:name)
irb(main):016:0> tag = ActsAsTaggableOn::Tag.find_by(name: "Africa") irb(main):017:0> tag.children.count ActsAsTaggableOn::Tag Count (0.5ms) SELECT COUNT(*) FROM "aat_tags" WHERE "aat_tags"."parent_name" = $1 [["parent_name", "Africa"]] => 60 irb(main):018:0> tag.children_count ActsAsTaggableOn::Tag Count (1.2ms) SELECT COUNT(*) AS "count_all", "aat_tags"."parent_name" AS "aat_tags_parent_name" FROM "aat_tags" WHERE "aat_tags"."parent_name" = $1 GROUP BY "aat_tags"."parent_name" [["parent_name", "3018"]] => 0 irb(main):019:0> tag.id => 3018
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
I have an association where I use a text string for my primary key.
when I do eager_group count, it is associating with the object's id instead of the association's PK (:name)
The text was updated successfully, but these errors were encountered: