Permalink
Browse files

Added a failing test for "OR" conditions where the columns are all vi…

…a associations
  • Loading branch information...
1 parent 21486ea commit 5e13e5aeee72c8a50de119e2f7dc73ed095fda69 Scott committed with Oct 23, 2009
Showing with 3 additions and 1 deletion.
  1. +2 −1 spec/named_scopes/or_conditions_spec.rb
  2. +1 −0 spec/spec_helper.rb
@@ -43,5 +43,6 @@
lambda { User.name_or_company_name_like("ben") }.should_not raise_error(Searchlogic::NamedScopes::OrConditions::NoConditionSpecifiedError)
User.name_or_company_name_like("ben").proxy_options.should == {:joins => :company, :conditions => "(users.name LIKE '%ben%') OR (companies.name LIKE '%ben%')"}
User.company_name_or_name_like("ben").proxy_options.should == {:joins => :company, :conditions => "(companies.name LIKE '%ben%') OR (users.name LIKE '%ben%')"}
+ User.company_name_or_company_description_like("ben").proxy_options.should == {:joins => :company, :conditions => "(companies.name LIKE '%ben%') OR (company.description LIKE '%ben%')"}
end
-end
+end
View
@@ -15,6 +15,7 @@
t.datetime :created_at
t.datetime :updated_at
t.string :name
+ t.string :description
t.integer :users_count, :default => 0
end

0 comments on commit 5e13e5a

Please sign in to comment.