Closed kandadaboggu closed 12 years ago
Sorry, but tenacity does not support conditions on the associations.
However, you may be able to use User#post_ids
to limit the query to only posts that belong to the user, and then add your additional query parameter. Perhaps something like:
Post.where(:id => current_user.post_ids, :name => "foo")
Sorry, but tenacity does not support conditions on the associations.
I wanted to confirmed that.
As of now I am directly querying the Post
model as follows:
Post.where(:user_id => current_user.id, :name => "foo")
PS: Is Mongoid 3 support in the roadmap?
I'm not actively working on tenacity at the moment, just fixing bugs and merging pull requests. So, there are no immediate plans to support Mongoid 3. However, if somebody were to add support for it, I would happily merge it in.
How do I chain the conditions on an association pointing to a Mongoid model?
When I try to apply a conditions on the
has_many
associationtenacity
throws error(undefined method 'where' for []:Array
)