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

Order clause is broken - +options[:order]+ entry #<Origin::Key:0x00000004c1bc50...> of an unsupported object Origin::Key (ArgumentError) #287

Open
brian-thrillist opened this issue Aug 27, 2015 · 1 comment

Comments

@brian-thrillist
Copy link

I can't use the order clause in Zoo.all(order: [:created_at.desc]). It still works without the desc or asc bit.
Running ruby-2.2.2, data_objects (0.10.16), and datamapper (1.2.0)

Please see this stackoverflow post.

Stack trace:

/usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:968:in `block in assert_valid_order': +options[:order]+ entry #<Origin::Key:0x00000004c1bc50 @name=:silly_name, @strategy=:__override__, @operator=-1, @expanded=nil, @block=nil> of an unsupported object Origin::Key (ArgumentError)
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:947:in `each'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:947:in `assert_valid_order'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:773:in `block in assert_valid_options'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:766:in `each'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:766:in `assert_valid_options'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:363:in `update'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/query.rb:386:in `merge'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/model.rb:767:in `scoped_query'
from /usr/local/rvm/gems/ruby-2.2.2/gems/dm-core-1.2.1/lib/dm-core/model.rb:342:in `all'
from test.rb:14:in `<main>'

Gemset:

data_objects (0.10.16)
datamapper (1.2.0
dm-aggregates (1.2.0)
dm-chunked_query (0.3.1)
dm-constraints (1.2.0)
dm-core (1.2.1)
dm-do-adapter (1.2.0)
dm-migrations (1.2.0)
dm-mysql-adapter (1.2.0)
dm-pager (1.1.0)
dm-serializer (1.2.2)
dm-timestamps (1.2.0)
dm-transactions (1.2.0)
dm-types (1.2.2)
dm-validations (1.2.0)
@tpitale
Copy link
Member

tpitale commented May 24, 2016

Are those the only gems? I have no idea what Origin::Key is … or where it's coming from. My guess is there might another gem that monkey-patches Symbol with methods like desc or asc and it blows away what DM does.

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

2 participants