searchlogic 2.4.10 → 2.4.11
Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml
CHANGED
@@ -34,7 +34,7 @@ module Searchlogic
|
|
34
34
|
if name_with_condition.to_s =~ /^(#{non_poly_assocs.collect(&:name).join("|")})_(\w+)$/
|
35
35
|
association_name = $1
|
36
36
|
condition = $2
|
37
|
-
elsif name_with_condition.to_s =~ /^(#{poly_assocs.collect(&:name).join("|")})_(\w
|
37
|
+
elsif name_with_condition.to_s =~ /^(#{poly_assocs.collect(&:name).join("|")})_(\w+?)_type_(\w+)$/
|
38
38
|
association_name = $1
|
39
39
|
poly_type = $2
|
40
40
|
condition = $3
|
data/searchlogic.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{searchlogic}
|
8
|
-
s.version = "2.4.
|
8
|
+
s.version = "2.4.11"
|
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"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-11}
|
13
13
|
s.description = %q{Searchlogic makes using ActiveRecord named scopes easier and less repetitive.}
|
14
14
|
s.email = %q{bjohnson@binarylogic.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -172,6 +172,13 @@ describe "Association Conditions" do
|
|
172
172
|
}
|
173
173
|
end
|
174
174
|
|
175
|
+
it "should delegate to polymorphic relationships (with a lazy split on _type_)" do
|
176
|
+
Audit.auditable_user_type_some_type_id_like("ben").proxy_options.should == {
|
177
|
+
:conditions => ["users.some_type_id LIKE ?", "%ben%"],
|
178
|
+
:joins => "INNER JOIN \"users\" ON \"users\".id = \"audits\".auditable_id AND \"audits\".auditable_type = 'User'"
|
179
|
+
}
|
180
|
+
end
|
181
|
+
|
175
182
|
it "should deep delegate to polymorphic relationships" do
|
176
183
|
Audit.auditable_user_type_company_name_like("company").proxy_options.should == {
|
177
184
|
:conditions => ["companies.name LIKE ?", "%company%"],
|
data/spec/spec_helper.rb
CHANGED
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.
|
4
|
+
version: 2.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson of Binary Logic
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-11 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|