Reputation: 1016
I am using ryanb-scope-builder and I am facing following issue.
def self.search(options)
scope_builder do |builder|
builder.released.visible
builder.cheap if options[:cheap]
end
end
This generates query which has :
builder.released.visible *AND* builder.cheap if options[:cheap]
Whereas I want scope to be OR'ed like
builder.released.visible *OR* builder.cheap if options[:cheap]
Is there any scope builder gem which can solve this problem ?? thanks
Upvotes: 1
Views: 480
Reputation: 115541
I don't know this scope builder but generally, OR queries are made with Arel.
Have a look here: ActiveRecord OR query
Besides, I doubt this gem is that useful:
scopes are natively easy to chain
the last commit was in 2009
Upvotes: 2