search_cop 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0cdde213f37d4e7a63dcca4a3d4ed4c3cf7b2aa
4
- data.tar.gz: 52b11b8e9c1ecfbae19fd1f82d8a70f1eec08756
3
+ metadata.gz: d4a775b683b6b8ac71ce65abf70db3c1765bc7af
4
+ data.tar.gz: b6ddb81eb3bb8655cfe5db72ed4b15643591cc02
5
5
  SHA512:
6
- metadata.gz: 22dc719d4506c0036e0a39480f8e52785b2f985f33392f378d1dfc186dd0608d7d1c41c058c585251483dd403ffc197d6e8ba3e0184bf6eccb3456c54ac9fc2a
7
- data.tar.gz: 5da7063ff0d1edadadae90ac08bb5b53754636b17152127c6f2b2c647526f3899587e88ce5d5879380f72a20813aaf4bba5195567e55cf6e8996b4bd8f9e8903
6
+ metadata.gz: 0eddb0f8dabfe5628931ecf79f2663c58b76e0e373beb77dc6e3e0dbf7b1020e415494bcd00422bc9ff7cd991b4b9acfd0ca469819dab48fa80ebb00f0bc7677
7
+ data.tar.gz: 3c7abb35d981b0c8e5068eefdcf4096b66bc785fea90c161ff0c5de453d0dd766753ebf8863415f4ee9eac791490dbe357343f87d61b25f47245d0ef593020fb
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
 
2
2
  # Changelog
3
3
 
4
+ Version 1.0.8:
5
+
6
+ * No longer add search scope methods globally #34
7
+
8
+ Version 1.0.7:
9
+
10
+ * Bugfix regarding NOT queries in fulltext mode #32
11
+ * Safely handle NULL values for match queries
12
+ * Added coalesce option
13
+
4
14
  Version 1.0.6:
5
15
 
6
16
  * Fixes a bug regarding date overflows in PostgreSQL
data/lib/search_cop.rb CHANGED
@@ -41,8 +41,8 @@ module SearchCop
41
41
  search_scopes[name] = SearchScope.new(name, self)
42
42
  search_scopes[name].instance_exec(&block)
43
43
 
44
- self.class.send(:define_method, name) { |query| search_cop query, name }
45
- self.class.send(:define_method, "unsafe_#{name}") { |query| unsafe_search_cop query, name }
44
+ self.send(:define_singleton_method, name) { |query| search_cop query, name }
45
+ self.send(:define_singleton_method, "unsafe_#{name}") { |query| unsafe_search_cop query, name }
46
46
  end
47
47
 
48
48
  def search_reflection(scope_name)
@@ -1,3 +1,3 @@
1
1
  module SearchCop
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
@@ -131,5 +131,10 @@ class SearchCopTest < SearchCop::TestCase
131
131
  def test_blank
132
132
  assert_equal Product.all, Product.search("")
133
133
  end
134
+
135
+ def test_not_adding_search_to_object
136
+ Product
137
+ assert_equal false, Object.respond_to?(:search)
138
+ end
134
139
  end
135
140
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Vetter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop