
Composite keys can't be used for ordering
Reported by bodhi | September 25th, 2009 @ 02:19 AM | in 0.10.2
class NoId
include DataMapper::Resource
property :not_id, Integer, :key => true
property :other_key, Integer, :key => true
end
irb(main):002:0> NoId.all :order => [:other_key]
~ (0.000036) SELECT "not_id", "other_key" FROM "no_ids" ORDER BY "other_key"
Seems ok...
irb(main):003:0> NoId.all :not_id => 1, :order => [:other_key]
~ (0.000554) SELECT "not_id", "other_key" FROM "no_ids" WHERE "not_id" = 1
The order by
clause is ignored when any of the
properties of the composite key are used in the conditions.
Comments and changes to this ticket
-
Dan Kubb (dkubb) October 7th, 2009 @ 12:54 PM
- Milestone set to 0.10.2
- State changed from new to resolved
- Assigned user set to Dan Kubb (dkubb)
This should now be resolved in edge dm-core.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »