searchlogic 2.3.13 → 2.3.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :major: 2
3
3
  :minor: 3
4
4
  :build:
5
- :patch: 13
5
+ :patch: 14
@@ -123,16 +123,16 @@ 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| send(scope, *args) })
126
+ merge_scopes_with_or(scopes.collect { |scope| clone.send(scope, *args) })
127
127
  }
128
128
  end
129
129
 
130
130
  def merge_scopes_with_or(scopes)
131
- scopes_options = scopes.collect { |scope| scope.proxy_options }
131
+ scopes_options = scopes.collect { |scope| scope.scope(:find) }
132
132
  conditions = scopes_options.reject { |o| o[:conditions].nil? }.collect { |o| sanitize_sql(o[:conditions]) }
133
133
  scope = scopes_options.inject(scoped({})) { |current_scope, options| current_scope.scoped(options) }
134
134
  options = scope.scope(:find)
135
- options.delete(:readonly) unless scope.proxy_options.key?(:readonly)
135
+ options.delete(:readonly) unless scopes.any? { |scope| scope.proxy_options.key?(:readonly) }
136
136
  options.merge(:conditions => "(" + conditions.join(") OR (") + ")")
137
137
  end
138
138
  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.3.13"
8
+ s.version = "2.3.14"
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"]
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.13
4
+ version: 2.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic