textacular 5.0.1 → 5.1.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +2 -0
- data/Rakefile +12 -2
- data/lib/textacular.rb +3 -3
- data/lib/textacular/migration_generator.rb +1 -0
- data/lib/textacular/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bd98a4fec2d72714909b49059a7f8b50298d734
|
4
|
+
data.tar.gz: 9b3fc608d5192296392da8323048c65440146cbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e1cd1fdce05d21df1e9803ca0bd1db66fc18ba371a4980175824ad5c46df5eb1e4cfd1aed857e5cea384887734f7f563ce498cc860c8c8827873f669a9ca584
|
7
|
+
data.tar.gz: 6237664f59c95a81b48283b3f761289a8c63199c908fba347e3931be9f93c59f5be897c971434266a7d1a203dfc3aa11af217736ca2e3313cea180c73c0d16c3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 5.1.0
|
6
|
+
|
7
|
+
* ActiveRecord 5.2 compatibility by wrapping string queries with `Arel.sql()`
|
8
|
+
* Adds latest Ruby, Rails and Postgres-dependencies to Travis.
|
9
|
+
* Rewrite development migration code to support Rails 5.0-5.2.
|
10
|
+
|
5
11
|
## 5.0.0
|
6
12
|
|
7
13
|
* ActiveRecord 5.1 compatibility
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -43,12 +43,22 @@ namespace :db do
|
|
43
43
|
|
44
44
|
desc 'Run the test database migrations'
|
45
45
|
task :up => :'db:connect' do
|
46
|
-
ActiveRecord
|
46
|
+
migrations = if ActiveRecord.version.version >= '5.2'
|
47
|
+
ActiveRecord::Migration.new.migration_context.migrations
|
48
|
+
else
|
49
|
+
ActiveRecord::Migrator.migrations('db/migrate')
|
50
|
+
end
|
51
|
+
ActiveRecord::Migrator.new(:up, migrations, nil).migrate
|
47
52
|
end
|
48
53
|
|
49
54
|
desc 'Reverse the test database migrations'
|
50
55
|
task :down => :'db:connect' do
|
51
|
-
ActiveRecord
|
56
|
+
migrations = if ActiveRecord.version.version >= '5.2'
|
57
|
+
ActiveRecord::Migration.new.migration_context.migrations
|
58
|
+
else
|
59
|
+
ActiveRecord::Migrator.migrations('db/migrate')
|
60
|
+
end
|
61
|
+
ActiveRecord::Migrator.new(:down, migrations, nil).migrate
|
52
62
|
end
|
53
63
|
end
|
54
64
|
task :migrate => :'migrate:up'
|
data/lib/textacular.rb
CHANGED
@@ -123,9 +123,9 @@ module Textacular
|
|
123
123
|
def assemble_query(similarities, conditions, exclusive)
|
124
124
|
rank = connection.quote_column_name('rank' + rand(100000000000000000).to_s)
|
125
125
|
|
126
|
-
select("#{quoted_table_name + '.*,' if select_values.empty?} #{similarities.join(" + ")} AS #{rank}").
|
126
|
+
select(Arel.sql("#{quoted_table_name + '.*,' if select_values.empty?} #{similarities.join(" + ")} AS #{rank}")).
|
127
127
|
where(conditions.join(exclusive ? " AND " : " OR ")).
|
128
|
-
order("#{rank} DESC")
|
128
|
+
order(Arel.sql("#{rank} DESC"))
|
129
129
|
end
|
130
130
|
|
131
131
|
def select_values
|
@@ -151,7 +151,7 @@ module Textacular
|
|
151
151
|
module Helper
|
152
152
|
class << self
|
153
153
|
def normalize(query)
|
154
|
-
query.to_s.gsub(/\s(?![
|
154
|
+
query.to_s.gsub(/\s(?![\&\!\|])/, '\\\\ ')
|
155
155
|
end
|
156
156
|
end
|
157
157
|
end
|
data/lib/textacular/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Hamill
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2018-05-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: pg
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 1.0.0
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.0.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,20 +103,20 @@ dependencies:
|
|
103
103
|
requirements:
|
104
104
|
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: '
|
106
|
+
version: '5.0'
|
107
107
|
- - "<"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '6.0'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
116
|
+
version: '5.0'
|
117
117
|
- - "<"
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
119
|
+
version: '6.0'
|
120
120
|
description: |-
|
121
121
|
Textacular exposes full text search capabilities from PostgreSQL, extending
|
122
122
|
ActiveRecord with scopes making search easy and fun!
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
183
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.
|
184
|
+
rubygems_version: 2.6.8
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: Textacular exposes full text search capabilities from PostgreSQL
|