searchlogic 2.3.14 → 2.3.15

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: 14
5
+ :patch: 15
@@ -91,6 +91,8 @@ module Searchlogic
91
91
  def prepare_named_scope_options(options, association)
92
92
  options.delete(:readonly) # AR likes to set :readonly to true when using the :joins option, we don't want that
93
93
 
94
+ options[:conditions] = sanitize_sql_for_conditions(options[:conditions]) if options[:conditions].is_a?(Hash)
95
+
94
96
  if options[:joins].is_a?(String) || array_of_strings?(options[:joins])
95
97
  options[:joins] = [inner_joins(association.name), options[:joins]].flatten
96
98
  else
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.14"
8
+ s.version = "2.3.15"
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"]
@@ -137,5 +137,9 @@ describe "Association Conditions" do
137
137
  user = company.users.create(:company_id => company.id)
138
138
  company.users.company_id_eq(company.id).should == [user]
139
139
  end
140
-
140
+
141
+ it "should sanitize the scope on a foreign model instead of passing the raw options back to the original" do
142
+ Company.named_scope(:users_count_10, :conditions => {:users_count => 10})
143
+ User.company_users_count_10.proxy_options.should == {:conditions => "\"users\".\"users_count\" = 10", :joins => :company}
144
+ end
141
145
  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.3.14
4
+ version: 2.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic