texticle 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,22 @@
1
+ == 2.0.2
2
+
3
+ * 1 bugfix
4
+
5
+ * Our #respond_to? overwritten method was causing failures when a model didn't have
6
+ a table (e.g. if migrations hadn't been run yet). Not the case anymore.
7
+
8
+ == 2.0.1
9
+
10
+ * 1 new feature
11
+
12
+ * Can now define #searchable_language to specify the language used for the query. This changes
13
+ what's considered a stop word on Postgres' side. 'english' is the default language.
14
+
15
+ * 1 bugfix
16
+
17
+ * We were only specifying a language in to_tsvector() and not in to_tsquery(), which could
18
+ cause queries to fail if the default database language wasn't set to 'english'.
19
+
1
20
  == 2.0.pre4
2
21
 
3
22
  * 1 new feature
@@ -49,7 +49,9 @@ module Texticle
49
49
 
50
50
  def respond_to?(method, include_private = false)
51
51
  return super if self == ActiveRecord::Base
52
- Helper.dynamic_search_method?(method, self.columns) ? true : super
52
+ Helper.dynamic_search_method?(method, self.columns) or super
53
+ rescue ActiveRecord::StatementInvalid
54
+ super
53
55
  end
54
56
 
55
57
  private
@@ -10,6 +10,10 @@ class Game < ActiveRecord::Base
10
10
  end
11
11
  end
12
12
 
13
+ class NotThere < ActiveRecord::Base
14
+
15
+ end
16
+
13
17
  class TexticleTest < Test::Unit::TestCase
14
18
 
15
19
  context "after extending ActiveRecord::Base" do
@@ -23,6 +27,13 @@ class TexticleTest < Test::Unit::TestCase
23
27
  end
24
28
  end
25
29
 
30
+ should "not break #respond_to? for table-less classes" do
31
+ assert !NotThere.table_exists?
32
+ assert_nothing_raised do
33
+ NotThere.respond_to? :system
34
+ end
35
+ end
36
+
26
37
  should "not break #method_missing" do
27
38
  begin
28
39
  ActiveRecord::Base.random
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texticle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pg
18
- requirement: &2168525460 !ruby/object:Gem::Requirement
18
+ requirement: &2156472340 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 0.11.0
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *2168525460
26
+ version_requirements: *2156472340
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shoulda
29
- requirement: &2168524980 !ruby/object:Gem::Requirement
29
+ requirement: &2156471820 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 2.11.3
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *2168524980
37
+ version_requirements: *2156471820
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: activerecord
40
- requirement: &2168524500 !ruby/object:Gem::Requirement
40
+ requirement: &2156471320 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: 3.0.0
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2168524500
48
+ version_requirements: *2156471320
49
49
  description: ! "Texticle exposes full text search capabilities from PostgreSQL, extending\n
50
50
  \ ActiveRecord with scopes making search easy and fun!"
51
51
  email: