ruby acts-as-taggable-on gem tag_counts_on method with tenant conditions

57 Views Asked by At

Love this gem and I've studied the source code but I'm stumped. I suspect I'm close but I need help finalizing this syntax. Please!!

Pizza.tag_counts_on(:topping, {conditions: "WHERE tenant IS '1'"}) (Yup, tenant is a string!)

This syntax results in error (Object doesn't support #inspect) (Same error if I try a tenant as an int.)

1

There are 1 best solutions below

2
Carl Sastre On

Haven't used this gem, but can't you provide the conditions to the base class?

Pizza.where(tenant: '1').tag_counts_on(:topping)

Hope that helps?