searchlogic 2.4.27 → 2.4.28
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/Rakefile +0 -1
- data/VERSION.yml +1 -1
- data/lib/searchlogic/active_record/association_proxy.rb +2 -2
- data/searchlogic.gemspec +58 -62
- data/spec/searchlogic/active_record/association_proxy_spec.rb +5 -0
- data/spec/spec_helper.rb +8 -2
- metadata +7 -24
- data/.gitignore +0 -6
data/Rakefile
CHANGED
|
@@ -10,7 +10,6 @@ begin
|
|
|
10
10
|
gem.email = "bjohnson@binarylogic.com"
|
|
11
11
|
gem.homepage = "http://github.com/binarylogic/searchlogic"
|
|
12
12
|
gem.authors = ["Ben Johnson of Binary Logic"]
|
|
13
|
-
gem.rubyforge_project = "searchlogic"
|
|
14
13
|
gem.add_dependency "activerecord", ">= 2.0.0"
|
|
15
14
|
end
|
|
16
15
|
Jeweler::GemcutterTasks.new
|
data/VERSION.yml
CHANGED
|
@@ -6,9 +6,9 @@ module Searchlogic
|
|
|
6
6
|
alias_method_chain :send, :searchlogic
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
def send_with_searchlogic(method, *args)
|
|
11
|
-
if !proxy_respond_to?(method) && !proxy_reflection.options[:polymorphic] && proxy_reflection.klass.condition?(method)
|
|
11
|
+
if !proxy_respond_to?(method) && proxy_reflection.macro != :belongs_to && !proxy_reflection.options[:polymorphic] && proxy_reflection.klass.condition?(method)
|
|
12
12
|
proxy_reflection.klass.send(method, *args)
|
|
13
13
|
else
|
|
14
14
|
send_without_searchlogic(method, *args)
|
data/searchlogic.gemspec
CHANGED
|
@@ -1,89 +1,85 @@
|
|
|
1
1
|
# Generated by jeweler
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{searchlogic}
|
|
8
|
-
s.version = "2.4.
|
|
8
|
+
s.version = "2.4.28"
|
|
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{
|
|
12
|
+
s.date = %q{2011-02-28}
|
|
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 = [
|
|
16
16
|
"LICENSE",
|
|
17
|
-
|
|
17
|
+
"README.rdoc"
|
|
18
18
|
]
|
|
19
19
|
s.files = [
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"spec/spec_helper.rb"
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"README.rdoc",
|
|
22
|
+
"Rakefile",
|
|
23
|
+
"VERSION.yml",
|
|
24
|
+
"init.rb",
|
|
25
|
+
"lib/searchlogic.rb",
|
|
26
|
+
"lib/searchlogic/active_record/association_proxy.rb",
|
|
27
|
+
"lib/searchlogic/active_record/consistency.rb",
|
|
28
|
+
"lib/searchlogic/active_record/named_scope_tools.rb",
|
|
29
|
+
"lib/searchlogic/core_ext/object.rb",
|
|
30
|
+
"lib/searchlogic/core_ext/proc.rb",
|
|
31
|
+
"lib/searchlogic/named_scopes/alias_scope.rb",
|
|
32
|
+
"lib/searchlogic/named_scopes/association_conditions.rb",
|
|
33
|
+
"lib/searchlogic/named_scopes/association_ordering.rb",
|
|
34
|
+
"lib/searchlogic/named_scopes/conditions.rb",
|
|
35
|
+
"lib/searchlogic/named_scopes/or_conditions.rb",
|
|
36
|
+
"lib/searchlogic/named_scopes/ordering.rb",
|
|
37
|
+
"lib/searchlogic/rails_helpers.rb",
|
|
38
|
+
"lib/searchlogic/search.rb",
|
|
39
|
+
"lib/searchlogic/search/base.rb",
|
|
40
|
+
"lib/searchlogic/search/conditions.rb",
|
|
41
|
+
"lib/searchlogic/search/date_parts.rb",
|
|
42
|
+
"lib/searchlogic/search/implementation.rb",
|
|
43
|
+
"lib/searchlogic/search/method_missing.rb",
|
|
44
|
+
"lib/searchlogic/search/ordering.rb",
|
|
45
|
+
"lib/searchlogic/search/scopes.rb",
|
|
46
|
+
"lib/searchlogic/search/to_yaml.rb",
|
|
47
|
+
"lib/searchlogic/search/unknown_condition_error.rb",
|
|
48
|
+
"rails/init.rb",
|
|
49
|
+
"searchlogic.gemspec",
|
|
50
|
+
"spec/searchlogic/active_record/association_proxy_spec.rb",
|
|
51
|
+
"spec/searchlogic/active_record/consistency_spec.rb",
|
|
52
|
+
"spec/searchlogic/core_ext/object_spec.rb",
|
|
53
|
+
"spec/searchlogic/core_ext/proc_spec.rb",
|
|
54
|
+
"spec/searchlogic/named_scopes/alias_scope_spec.rb",
|
|
55
|
+
"spec/searchlogic/named_scopes/association_conditions_spec.rb",
|
|
56
|
+
"spec/searchlogic/named_scopes/association_ordering_spec.rb",
|
|
57
|
+
"spec/searchlogic/named_scopes/conditions_spec.rb",
|
|
58
|
+
"spec/searchlogic/named_scopes/or_conditions_spec.rb",
|
|
59
|
+
"spec/searchlogic/named_scopes/ordering_spec.rb",
|
|
60
|
+
"spec/searchlogic/search_spec.rb",
|
|
61
|
+
"spec/spec_helper.rb"
|
|
63
62
|
]
|
|
64
63
|
s.homepage = %q{http://github.com/binarylogic/searchlogic}
|
|
65
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
|
66
64
|
s.require_paths = ["lib"]
|
|
67
|
-
s.
|
|
68
|
-
s.rubygems_version = %q{1.3.7}
|
|
65
|
+
s.rubygems_version = %q{1.5.2}
|
|
69
66
|
s.summary = %q{Searchlogic makes using ActiveRecord named scopes easier and less repetitive.}
|
|
70
67
|
s.test_files = [
|
|
71
68
|
"spec/searchlogic/active_record/association_proxy_spec.rb",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
"spec/searchlogic/active_record/consistency_spec.rb",
|
|
70
|
+
"spec/searchlogic/core_ext/object_spec.rb",
|
|
71
|
+
"spec/searchlogic/core_ext/proc_spec.rb",
|
|
72
|
+
"spec/searchlogic/named_scopes/alias_scope_spec.rb",
|
|
73
|
+
"spec/searchlogic/named_scopes/association_conditions_spec.rb",
|
|
74
|
+
"spec/searchlogic/named_scopes/association_ordering_spec.rb",
|
|
75
|
+
"spec/searchlogic/named_scopes/conditions_spec.rb",
|
|
76
|
+
"spec/searchlogic/named_scopes/or_conditions_spec.rb",
|
|
77
|
+
"spec/searchlogic/named_scopes/ordering_spec.rb",
|
|
78
|
+
"spec/searchlogic/search_spec.rb",
|
|
79
|
+
"spec/spec_helper.rb"
|
|
83
80
|
]
|
|
84
81
|
|
|
85
82
|
if s.respond_to? :specification_version then
|
|
86
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
87
83
|
s.specification_version = 3
|
|
88
84
|
|
|
89
85
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
@@ -19,5 +19,10 @@ describe "Searchlogic::ActiveRecord::AssociationProxy" do
|
|
|
19
19
|
company.users.send(:username_or_some_type_id_like, "bjohnson").should == [user]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
it "should ignore belongs_to associations" do
|
|
23
|
+
user = User.create(:male => true)
|
|
24
|
+
cart = user.carts.create
|
|
25
|
+
cart.user.send("male").should == true
|
|
26
|
+
end
|
|
22
27
|
end
|
|
23
28
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
require 'spec'
|
|
2
2
|
require 'rubygems'
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require 'ruby-debug'
|
|
4
|
+
gem "activerecord", "2.3.11"
|
|
5
|
+
require "active_record"
|
|
5
6
|
|
|
6
7
|
ENV['TZ'] = 'UTC'
|
|
7
8
|
Time.zone = 'Eastern Time (US & Canada)'
|
|
@@ -91,12 +92,17 @@ Spec::Runner.configure do |config|
|
|
|
91
92
|
has_many :users, :dependent => :destroy
|
|
92
93
|
end
|
|
93
94
|
|
|
95
|
+
class ::Cart < ActiveRecord::Base
|
|
96
|
+
belongs_to :user
|
|
97
|
+
end
|
|
98
|
+
|
|
94
99
|
class ::UserGroup < ActiveRecord::Base
|
|
95
100
|
has_and_belongs_to_many :users
|
|
96
101
|
end
|
|
97
102
|
|
|
98
103
|
class ::User < ActiveRecord::Base
|
|
99
104
|
belongs_to :company, :counter_cache => true
|
|
105
|
+
has_many :carts, :dependent => :destroy
|
|
100
106
|
has_many :orders, :dependent => :destroy
|
|
101
107
|
has_many :orders_big, :class_name => 'Order', :conditions => 'total > 100'
|
|
102
108
|
has_and_belongs_to_many :user_groups
|
metadata
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: searchlogic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
segments:
|
|
7
|
-
- 2
|
|
8
|
-
- 4
|
|
9
|
-
- 27
|
|
10
|
-
version: 2.4.27
|
|
4
|
+
prerelease:
|
|
5
|
+
version: 2.4.28
|
|
11
6
|
platform: ruby
|
|
12
7
|
authors:
|
|
13
8
|
- Ben Johnson of Binary Logic
|
|
@@ -15,7 +10,7 @@ autorequire:
|
|
|
15
10
|
bindir: bin
|
|
16
11
|
cert_chain: []
|
|
17
12
|
|
|
18
|
-
date:
|
|
13
|
+
date: 2011-02-28 00:00:00 -05:00
|
|
19
14
|
default_executable:
|
|
20
15
|
dependencies:
|
|
21
16
|
- !ruby/object:Gem::Dependency
|
|
@@ -26,11 +21,6 @@ dependencies:
|
|
|
26
21
|
requirements:
|
|
27
22
|
- - ">="
|
|
28
23
|
- !ruby/object:Gem::Version
|
|
29
|
-
hash: 15
|
|
30
|
-
segments:
|
|
31
|
-
- 2
|
|
32
|
-
- 0
|
|
33
|
-
- 0
|
|
34
24
|
version: 2.0.0
|
|
35
25
|
type: :runtime
|
|
36
26
|
version_requirements: *id001
|
|
@@ -44,7 +34,6 @@ extra_rdoc_files:
|
|
|
44
34
|
- LICENSE
|
|
45
35
|
- README.rdoc
|
|
46
36
|
files:
|
|
47
|
-
- .gitignore
|
|
48
37
|
- LICENSE
|
|
49
38
|
- README.rdoc
|
|
50
39
|
- Rakefile
|
|
@@ -92,8 +81,8 @@ homepage: http://github.com/binarylogic/searchlogic
|
|
|
92
81
|
licenses: []
|
|
93
82
|
|
|
94
83
|
post_install_message:
|
|
95
|
-
rdoc_options:
|
|
96
|
-
|
|
84
|
+
rdoc_options: []
|
|
85
|
+
|
|
97
86
|
require_paths:
|
|
98
87
|
- lib
|
|
99
88
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -101,23 +90,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
101
90
|
requirements:
|
|
102
91
|
- - ">="
|
|
103
92
|
- !ruby/object:Gem::Version
|
|
104
|
-
hash: 3
|
|
105
|
-
segments:
|
|
106
|
-
- 0
|
|
107
93
|
version: "0"
|
|
108
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
95
|
none: false
|
|
110
96
|
requirements:
|
|
111
97
|
- - ">="
|
|
112
98
|
- !ruby/object:Gem::Version
|
|
113
|
-
hash: 3
|
|
114
|
-
segments:
|
|
115
|
-
- 0
|
|
116
99
|
version: "0"
|
|
117
100
|
requirements: []
|
|
118
101
|
|
|
119
|
-
rubyforge_project:
|
|
120
|
-
rubygems_version: 1.
|
|
102
|
+
rubyforge_project:
|
|
103
|
+
rubygems_version: 1.5.2
|
|
121
104
|
signing_key:
|
|
122
105
|
specification_version: 3
|
|
123
106
|
summary: Searchlogic makes using ActiveRecord named scopes easier and less repetitive.
|