#117 new

Associations with different conditions dont work

Reported by twalpole | January 27th, 2010 @ 12:40 PM

Given a class

    class A < ActiveRecord::Base
      belongs_to :b

and a class B with attributes firstname, lastname

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

This is caused by the last comparison condition always being appended when in an association (even if one is specified) so the code ends up looking for 'b_firstname_is_like'

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket