db_text_search 0.2.1 → 0.2.2

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: 056fe218cb672b103fec059b95bf7327da5cdc12
4
- data.tar.gz: b866b129a58f829aa4fdf0f658a052a28aaf0542
3
+ metadata.gz: b0172bff01c9eb57aab0b3946ef2b867bf998860
4
+ data.tar.gz: 4693691bcbeca4e5a0e8dedf9aac48fabc69d356
5
5
  SHA512:
6
- metadata.gz: b6ee2bf4e5244a12808290ff0b5b00848c6718a97e1ff36291c746b45143068946f982e76c57c336d8741bcc6a30c0a4697ea18911744c48377610a7dfa7a66f
7
- data.tar.gz: bb9f9f6c61b9be723fb62d7ea6c615f8e28db470a452347b871cb7574bda5b607906f03667a9fe1a57195101ddee484f546f1df6e9a08592180671131b5cc44f
6
+ metadata.gz: 84f63d51d4fcc3c92731101606036cd57253264c4bcbd376b03411d4a0a0e6d230702a481eb200c9d716e4f76e141ab2ce4e76971eecdc8f920aa83332b35050
7
+ data.tar.gz: 3f33248a25268519669f645d22a900f214a480eadd924bf0b1fe4bdbc59a2907d5e38458c8210f475d932ebe84745663aa45a3393a7b8c75d2388ce7f847b883
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.2.2
2
+
3
+ * Raises a more helpful error if the column is not found when calling
4
+ `DbTextSearch::CaseInsensitive`.
5
+
1
6
  ## v0.2.1
2
7
 
3
8
  * Support for PostGIS adapters.
data/README.md CHANGED
@@ -11,7 +11,7 @@ DbTextSearch provides a unified interface on top of ActiveRecord for SQLite, MyS
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'db_text_search', '~> 0.2.1'
14
+ gem 'db_text_search', '~> 0.2.2'
15
15
  ```
16
16
 
17
17
  ## Usage
@@ -32,5 +32,5 @@ Gem::Specification.new do |s|
32
32
  s.add_development_dependency 'rake', '~> 11.0'
33
33
  s.add_development_dependency 'rspec', '~> 3.4'
34
34
  s.add_development_dependency 'simplecov'
35
- s.add_development_dependency 'rubocop'
35
+ s.add_development_dependency 'rubocop', '= 0.49.1'
36
36
  end
@@ -89,8 +89,9 @@ module DbTextSearch
89
89
  # @return [Boolean]
90
90
  # @note sqlite not supported.
91
91
  # @api private
92
- def self.column_case_sensitive?(connection, table_name, column_name)
92
+ def self.column_case_sensitive?(connection, table_name, column_name) # rubocop:disable Metrics/AbcSize
93
93
  column = connection.schema_cache.columns(table_name).detect { |c| c.name == column_name.to_s }
94
+ fail "Column #{column_name.to_s.inspect} not found on table #{table_name.inspect}" if column.nil?
94
95
  DbTextSearch.match_adapter(
95
96
  connection,
96
97
  mysql: -> { column.case_sensitive? },
@@ -20,8 +20,7 @@ module DbTextSearch
20
20
  end
21
21
 
22
22
  # A no-op, as we just use LIKE for sqlite.
23
- def self.add_index(_connection, _table_name, _column_name, name:, pg_ts_config:)
24
- end
23
+ def self.add_index(_connection, _table_name, _column_name, name:, pg_ts_config:); end
25
24
  end
26
25
  end
27
26
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DbTextSearch
4
4
  # Gem version
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_text_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-01 00:00:00.000000000 Z
11
+ date: 2017-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -132,16 +132,16 @@ dependencies:
132
132
  name: rubocop
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">="
135
+ - - '='
136
136
  - !ruby/object:Gem::Version
137
- version: '0'
137
+ version: 0.49.1
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - '='
143
143
  - !ruby/object:Gem::Version
144
- version: '0'
144
+ version: 0.49.1
145
145
  description: Different relational databases treat text search very differently. DbTextSearch
146
146
  provides a unified interface on top of ActiveRecord for SQLite, MySQL, and PostgreSQL
147
147
  to do case-insensitive string-in-set querying and CI index creation, and basic full-text
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  requirements: []
193
193
  rubyforge_project:
194
- rubygems_version: 2.5.2
194
+ rubygems_version: 2.6.12
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: A unified interface on top of ActiveRecord for SQLite, MySQL, and PostgreSQLfor