binarylogic-searchlogic 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc
CHANGED
data/VERSION.yml
CHANGED
@@ -22,7 +22,7 @@ module Searchlogic
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def method_missing(name, *args, &block)
|
25
|
-
if details = association_condition_details(name)
|
25
|
+
if !local_condition?(name) && details = association_condition_details(name)
|
26
26
|
create_association_condition(details[:association], details[:condition], args)
|
27
27
|
send(name, *args)
|
28
28
|
else
|
@@ -67,12 +67,16 @@ module Searchlogic
|
|
67
67
|
|
68
68
|
# Is the name of the method a valid condition that can be dynamically created?
|
69
69
|
def condition?(name)
|
70
|
-
|
71
|
-
scope_names = scopes.keys.reject { |k| k == :scoped }
|
72
|
-
scope_names.include?(name.to_sym) || !condition_details(name).nil?
|
70
|
+
local_condition?(name)
|
73
71
|
end
|
74
72
|
|
75
73
|
private
|
74
|
+
def local_condition?(name)
|
75
|
+
return false if name.blank?
|
76
|
+
scope_names = scopes.keys.reject { |k| k == :scoped }
|
77
|
+
scope_names.include?(name.to_sym) || !condition_details(name).nil?
|
78
|
+
end
|
79
|
+
|
76
80
|
def method_missing(name, *args, &block)
|
77
81
|
if details = condition_details(name)
|
78
82
|
create_condition(details[:column], details[:condition], args)
|
data/searchlogic.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{searchlogic}
|
5
|
-
s.version = "2.2.
|
5
|
+
s.version = "2.2.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ben Johnson of Binary Logic"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-31}
|
10
10
|
s.description = %q{Searchlogic provides common named scopes and object based searching for ActiveRecord.}
|
11
11
|
s.email = %q{bjohnson@binarylogic.com}
|
12
12
|
s.extra_rdoc_files = [
|
@@ -270,5 +270,8 @@ describe "Conditions" do
|
|
270
270
|
|
271
271
|
it "should have priorty to columns over conflicting association conditions" do
|
272
272
|
Company.users_count_gt(10)
|
273
|
+
User.create
|
274
|
+
User.company_id_null.count.should == 1
|
275
|
+
User.company_id_not_null.count.should == 0
|
273
276
|
end
|
274
277
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binarylogic-searchlogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
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: 2009-07-
|
12
|
+
date: 2009-07-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|