We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I use a where on a model with polymorphic association i have an error
where
Inbox::Row.where( item: context.sub_item, module: 0, organization: context.organization, project: context.project ).first
In my model
belongs_to :item, polymorphic: true
i have this error
rails_1 | NoMethodError (undefined method `id' for nil:NilClass): rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/document/association/belongs_to.rb:103:in `cast_attr' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/document/association.rb:27:in `association_user_to_model_cast' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:200:in `cast_key_path' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:96:in `simplify' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:48:in `map' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:48:in `simplify' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:48:in `map' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:48:in `simplify' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:19:in `merge_where_ast' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:39:in `call' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:39:in `block in merge!' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:36:in `each' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:36:in `merge!' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/eager_load.rb:16:in `merge!' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/cache.rb:24:in `merge!' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/extend.rb:15:in `merge!' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:45:in `merge' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/core.rb:56:in `chain' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/criteria/where.rb:11:in `where' rails_1 | /usr/local/bundle/gems/nobrainer-0.43.0/lib/no_brainer/document/criteria.rb:16:in `where'
The text was updated successfully, but these errors were encountered:
first_or_create
Fixes first_or_create with polymorphic association (Closes #288)
d7f29ef
Fixes first_or_create with polymorphic association (Closes #288) (#289
2b21ff6
)
Successfully merging a pull request may close this issue.
When I use a
where
on a model with polymorphic association i have an errorIn my model
i have this error
The text was updated successfully, but these errors were encountered: