kazjote-searchlogic 2.1.9 → 2.1.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,7 +51,7 @@ module Searchlogic
51
51
  end
52
52
 
53
53
  def clone
54
- self.class.new(klass, current_scope.clone, conditions.clone)
54
+ self.class.new(klass, current_scope && current_scope.clone, conditions.clone)
55
55
  end
56
56
 
57
57
  # Returns a hash of the current conditions set.
data/searchlogic.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{searchlogic}
5
- s.version = "2.1.9"
5
+ s.version = "2.1.9.1"
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"]
data/spec/search_spec.rb CHANGED
@@ -40,6 +40,16 @@ describe "Search" do
40
40
  search1.all.should == [user2]
41
41
  end
42
42
 
43
+ it "should clone properly without scope" do
44
+ user1 = User.create(:age => 5)
45
+ user2 = User.create(:age => 25)
46
+ search1 = User.search(:age_gt => 10)
47
+ search2 = search1.clone
48
+ search2.age_gt = 1
49
+ search2.all.should == User.all
50
+ search1.all.should == [user2]
51
+ end
52
+
43
53
  it "should delete the condition" do
44
54
  search = User.search(:username_like => "bjohnson")
45
55
  search.delete("username_like")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kazjote-searchlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.9
4
+ version: 2.1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic
@@ -63,6 +63,7 @@ files:
63
63
  - spec/spec_helper.rb
64
64
  has_rdoc: false
65
65
  homepage: http://github.com/binarylogic/searchlogic
66
+ licenses:
66
67
  post_install_message:
67
68
  rdoc_options:
68
69
  - --charset=UTF-8
@@ -83,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
84
  requirements: []
84
85
 
85
86
  rubyforge_project: searchlogic
86
- rubygems_version: 1.2.0
87
+ rubygems_version: 1.3.5
87
88
  signing_key:
88
89
  specification_version: 3
89
90
  summary: Searchlogic provides common named scopes and object based searching for ActiveRecord.