Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work with embedded documents #1

Open
zerobearing2 opened this issue Jun 17, 2011 · 0 comments
Open

doesn't work with embedded documents #1

zerobearing2 opened this issue Jun 17, 2011 · 0 comments

Comments

@zerobearing2
Copy link

receiving this error when trying mongoid_order on embedded document association,

Access to the collection for Photo is not allowed since it is an embedded document, please access a collection from the root document.
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/collections.rb:27:in `collection'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/contexts/mongo.rb:53:in `blank?'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/criteria.rb:45:in `empty?'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/gems/mongoid_order-0.0.4/lib/mongoid_order.rb:148:in `assign_default_position'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/gems/activesupport-3.1.0.rc4/lib/active_support/callbacks.rb:395:in `_run_save_callbacks'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/gems/activesupport-3.1.0.rc4/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/persistence/insert.rb:26:in `block in persist'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/persistence/insert.rb:25:in `tap'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/persistence/insert.rb:25:in `persist'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/persistence.rb:47:in `insert'
/Users/david/.rvm/gems/ruby-1.9.2-p180@rails31/bundler/gems/mongoid-d86d31a18253/lib/mongoid/persistence.rb:148:in `upsert'
....

mongoid_order.rb:148:in `assign_default_position' -- obviously the collection is not available to an embedded doc, any good ideas on how the position could be calculated for embedded associations here? I'm unfamiliar with mongoids' association code, so haven't taken stab at solving this yet ....

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

No branches or pull requests

1 participant