searchlogic 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :major: 2
3
3
  :minor: 4
4
4
  :build:
5
- :patch: 0
5
+ :patch: 1
@@ -114,7 +114,7 @@ module Searchlogic
114
114
  if options[:joins].is_a?(String) || array_of_strings?(options[:joins])
115
115
  options[:joins] = [poly_class ? poly_join : inner_joins(association.name), options[:joins]].flatten
116
116
  elsif poly_class
117
- options[:joins] = options[:joins].blank? ? poly_join : [poly_join, inner_joins(options[:joins])]
117
+ options[:joins] = options[:joins].blank? ? poly_join : ([poly_join] + klass.inner_joins(options[:joins]))
118
118
  else
119
119
  options[:joins] = options[:joins].blank? ? association.name : {association.name => options[:joins]}
120
120
  end
data/searchlogic.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{searchlogic}
8
- s.version = "2.4.0"
8
+ s.version = "2.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Johnson of Binary Logic"]
@@ -143,10 +143,17 @@ describe "Association Conditions" do
143
143
  User.company_users_count_10.proxy_options.should == {:conditions => "\"companies\".\"users_count\" = 10", :joins => :company}
144
144
  end
145
145
 
146
- it "should polymorph" do
146
+ it "should delegate to polymorphic relationships" do
147
147
  Audit.auditable_user_type_name_like("ben").proxy_options.should == {
148
148
  :conditions => ["users.name LIKE ?", "%ben%"],
149
149
  :joins => "INNER JOIN \"users\" ON \"users\".id = \"audits\".auditable_id AND \"audits\".auditable_type = 'User'"
150
150
  }
151
151
  end
152
+
153
+ it "should deep delegate to polymorphic relationships" do
154
+ Audit.auditable_user_type_company_name_like("company").proxy_options.should == {
155
+ :conditions => ["companies.name LIKE ?", "%company%"],
156
+ :joins => ["INNER JOIN \"users\" ON \"users\".id = \"audits\".auditable_id AND \"audits\".auditable_type = 'User'", " INNER JOIN \"companies\" ON \"companies\".id = \"users\".company_id "]
157
+ }
158
+ end
152
159
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic