searchlogic 2.3.12 → 2.3.13
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/searchlogic/named_scopes/or_conditions.rb +3 -8
- data/searchlogic.gemspec +2 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
@@ -123,19 +123,14 @@ module Searchlogic
|
|
123
123
|
scope = named_scope_options(scopes.first)
|
124
124
|
column_type = scope.respond_to?(:searchlogic_arg_type) ? scope.searchlogic_arg_type : :string
|
125
125
|
named_scope scopes.join("_or_"), searchlogic_lambda(column_type) { |*args|
|
126
|
-
merge_scopes_with_or(scopes.collect { |scope|
|
126
|
+
merge_scopes_with_or(scopes.collect { |scope| send(scope, *args) })
|
127
127
|
}
|
128
128
|
end
|
129
129
|
|
130
130
|
def merge_scopes_with_or(scopes)
|
131
|
-
scopes_options = scopes.collect { |scope
|
131
|
+
scopes_options = scopes.collect { |scope| scope.proxy_options }
|
132
132
|
conditions = scopes_options.reject { |o| o[:conditions].nil? }.collect { |o| sanitize_sql(o[:conditions]) }
|
133
|
-
|
134
|
-
scope = scopes.inject(scoped({})) do |scope, info|
|
135
|
-
scope_name, *args = info
|
136
|
-
scope.send(scope_name, *args)
|
137
|
-
end
|
138
|
-
|
133
|
+
scope = scopes_options.inject(scoped({})) { |current_scope, options| current_scope.scoped(options) }
|
139
134
|
options = scope.scope(:find)
|
140
135
|
options.delete(:readonly) unless scope.proxy_options.key?(:readonly)
|
141
136
|
options.merge(:conditions => "(" + conditions.join(") OR (") + ")")
|
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.3.
|
8
|
+
s.version = "2.3.13"
|
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-01-
|
12
|
+
s.date = %q{2010-01-22}
|
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 = [
|
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.3.
|
4
|
+
version: 2.3.13
|
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-01-
|
12
|
+
date: 2010-01-22 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|