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

the :id assumption #1

Open
vasili-zolotov opened this issue Nov 5, 2010 · 1 comment
Open

the :id assumption #1

vasili-zolotov opened this issue Nov 5, 2010 · 1 comment

Comments

@vasili-zolotov
Copy link

Very useful! Unfortunately it broke right away due to widespread assumption about keys in the model. I skimmed the source and it seems to assume the primary key is :id. Exactly in the cases where I need search my model uses a natural key. The the thing is coming down with when attempting to call search on the class.

NoMethodError: undefined method lazy_load' for nil:NilClass from (eval):2:inmethod_missing'
from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/resource/state/persisted.rb:23:in lazy_load' from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/resource/state/persisted.rb:8:inget'
from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/resource.rb:254:in []' from /usr/lib/ruby/gems/1.8/gems/dm-is-searchable-1.0.2/lib/dm-is-searchable/is/searchable.rb:32:insearch'
from (irb):5:in collect' from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/collection.rb:511:ineach'
from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/support/lazy_array.rb:413:in each' from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/support/lazy_array.rb:413:ineach'
from /usr/lib/ruby/gems/1.8/gems/dm-core-1.0.2/lib/dm-core/collection.rb:508:in each' from /usr/lib/ruby/gems/1.8/gems/dm-is-searchable-1.0.2/lib/dm-is-searchable/is/searchable.rb:32:incollect'
from /usr/lib/ruby/gems/1.8/gems/dm-is-searchable-1.0.2/lib/dm-is-searchable/is/searchable.rb:32:in `search'

Any chance of a quick fix or am I on my own? Great stuff, please keep it up. :)

@dkubb
Copy link
Member

dkubb commented May 17, 2011

I would accept a patch that does this, but I am relatively unfamiliar with dm-ferret-adapter so I wouldn't be able to make this change for you.

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