searchlogic 2.3.12 → 2.3.13

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: 3
4
4
  :build:
5
- :patch: 12
5
+ :patch: 13
@@ -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| [scope, *args] })
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, *args| send(scope, *args).proxy_options }
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.12"
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-19}
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.12
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-19 00:00:00 -05:00
12
+ date: 2010-01-22 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency