searchlogic 2.4.1 → 2.4.2

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/README.rdoc CHANGED
@@ -20,11 +20,7 @@ Install the gem from rubyforge:
20
20
 
21
21
  sudo gem install searchlogic
22
22
 
23
- Or from github:
24
-
25
- sudo gem install binarylogic-searchlogic
26
-
27
- Now just include it in your project and you are ready to go.
23
+ Now just set it as a dependency in your project and you are ready to go.
28
24
 
29
25
  You can also install this as a plugin:
30
26
 
data/VERSION.yml CHANGED
@@ -2,4 +2,4 @@
2
2
  :major: 2
3
3
  :minor: 4
4
4
  :build:
5
- :patch: 1
5
+ :patch: 2
data/lib/searchlogic.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require "searchlogic/core_ext/proc"
2
2
  require "searchlogic/core_ext/object"
3
3
  require "searchlogic/active_record/consistency"
4
- require "searchlogic/active_record/named_scopes"
4
+ require "searchlogic/active_record/named_scope_tools"
5
5
  require "searchlogic/named_scopes/conditions"
6
6
  require "searchlogic/named_scopes/ordering"
7
7
  require "searchlogic/named_scopes/association_conditions"
@@ -19,7 +19,7 @@ module ActiveRecord # :nodoc: all
19
19
  end
20
20
  end
21
21
 
22
- ActiveRecord::Base.extend(Searchlogic::ActiveRecord::NamedScopes)
22
+ ActiveRecord::Base.extend(Searchlogic::ActiveRecord::NamedScopeTools)
23
23
  ActiveRecord::Base.extend(Searchlogic::NamedScopes::Conditions)
24
24
  ActiveRecord::Base.extend(Searchlogic::NamedScopes::AssociationConditions)
25
25
  ActiveRecord::Base.extend(Searchlogic::NamedScopes::AssociationOrdering)
@@ -1,7 +1,7 @@
1
1
  module Searchlogic
2
2
  module ActiveRecord
3
3
  # Adds methods that give extra information about a classes named scopes.
4
- module NamedScopes
4
+ module NamedScopeTools
5
5
  # Retrieves the options passed when creating the respective named scope. Ex:
6
6
  #
7
7
  # named_scope :whatever, :conditions => {:column => value}
@@ -100,7 +100,7 @@ module Searchlogic
100
100
  self
101
101
  end
102
102
  else
103
- scope = conditions.inject(klass.scoped(current_scope) || {}) do |scope, condition|
103
+ scope = conditions_array.inject(klass.scoped(current_scope) || {}) do |scope, condition|
104
104
  scope_name, value = condition
105
105
  scope_name = normalize_scope_name(scope_name)
106
106
  klass.send(scope_name, value) if !klass.respond_to?(scope_name)
@@ -122,6 +122,11 @@ module Searchlogic
122
122
  end
123
123
  end
124
124
 
125
+ # This is here as a hook to allow people to modify the order in which the conditions are called, for whatever reason.
126
+ def conditions_array
127
+ conditions.to_a
128
+ end
129
+
125
130
  def normalize_scope_name(scope_name)
126
131
  case
127
132
  when klass.scopes.key?(scope_name.to_sym) then scope_name.to_sym
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.4.1"
8
+ s.version = "2.4.2"
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-23}
12
+ s.date = %q{2010-01-26}
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 = [
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  "init.rb",
27
27
  "lib/searchlogic.rb",
28
28
  "lib/searchlogic/active_record/consistency.rb",
29
- "lib/searchlogic/active_record/named_scopes.rb",
29
+ "lib/searchlogic/active_record/named_scope_tools.rb",
30
30
  "lib/searchlogic/core_ext/object.rb",
31
31
  "lib/searchlogic/core_ext/proc.rb",
32
32
  "lib/searchlogic/named_scopes/alias_scope.rb",
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.4.1
4
+ version: 2.4.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: 2010-01-23 00:00:00 -05:00
12
+ date: 2010-01-26 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ files:
41
41
  - init.rb
42
42
  - lib/searchlogic.rb
43
43
  - lib/searchlogic/active_record/consistency.rb
44
- - lib/searchlogic/active_record/named_scopes.rb
44
+ - lib/searchlogic/active_record/named_scope_tools.rb
45
45
  - lib/searchlogic/core_ext/object.rb
46
46
  - lib/searchlogic/core_ext/proc.rb
47
47
  - lib/searchlogic/named_scopes/alias_scope.rb