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

Relation passed to #or must be structurally compatible fix? #16

Closed
DeeWBee opened this issue Mar 1, 2019 · 2 comments
Closed

Relation passed to #or must be structurally compatible fix? #16

DeeWBee opened this issue Mar 1, 2019 · 2 comments

Comments

@DeeWBee
Copy link

DeeWBee commented Mar 1, 2019

Rails: 4.2.7.1
Ruby: 2.2.5p319

I have the following line

return query.where(scope_hash.inject(query) { |query, (scope_name, ids)| query.or(query.public_send(scope_name, ids)) })

Currently I am getting Relation passed to #or must be structurally compatible. In doing some research, I came across rails/rails#24055, wherein the proposed solution is rails/rails#24055 (comment). When comparing where-or.rb to the github link, it seems the change is implemented; however, I wanted to get a second opinion. Is there anything that can be done to the gem? Or does my issue lie within my own code?

@bf4
Copy link
Collaborator

bf4 commented Mar 4, 2019

@DeeWBee most likely in your own code. esp since you'e not sharing what' sin scope_hash

@DeeWBee
Copy link
Author

DeeWBee commented Mar 5, 2019

@bf4 It turns out my mistake was a syntax error in another location (my own fault). Thanks for the response though!

@DeeWBee DeeWBee closed this as completed Mar 5, 2019
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