searchlogic icon indicating copy to clipboard operation
searchlogic copied to clipboard

using different conditions with associations and or doesnt work

Open twalpole opened this issue 16 years ago • 0 comments

Using searchlogic 2.4.2

Given a class class A < ActiveRecord::Base belongs_to :b end where b has attributes firstname and lastname

A.b_firstname_is_or_b_lastname_like('abc') throws the error "Searchlogic::NamedScopes::OrConditions::UnknownConditionError: The condition 'b_firstname_is' is not a valid condition

This is because when going through associations the last condition is always appened so it actually ends up trying to find 'b_firstname_is_like' even though the condtion of 'is' is already specified

twalpole avatar Jan 27 '10 02:01 twalpole