Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Has many IN query gives wrong results #36

Open
solnic opened this issue May 17, 2011 · 2 comments
Open

Has many IN query gives wrong results #36

solnic opened this issue May 17, 2011 · 2 comments

Comments

@solnic
Copy link
Contributor

solnic commented May 17, 2011

Entry.all( :tags => Tag.first ).size should equal Entry.all.select {|e| e.tags.include? Tag.first }.size

A complete example to illustrate the issue can be found at: https://gist.github.com/bdc83b7c7f8797517f03


Created by Robert Sköld - 2010-04-30 23:38:26 UTC

Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1259

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

I can confirm this behaviour with edge dm-core.

This is due to a problem with how many to many queries are formed when conditions are present. This likely won’t be resolved before the 1.0.0 launch, but will be handled quite soon after.

by Dan Kubb (dkubb)

@solnic
Copy link
Contributor Author

solnic commented May 17, 2011

Now this query just blows up, here’s a standalone: https://gist.github.com/884915

by Piotr Solnica (solnic)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant