-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for tsvector_column in associated_against (pg_search_scope)
Adds alternative option syntax for tsvector_column. Adds migration for tsvector aggregation. Adds support for tsvector columns in associated models. Missing: More tests and documentation.
- Loading branch information
1 parent
96bfffd
commit 3739a67
Showing
14 changed files
with
583 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
Gemfile.lock | ||
doc | ||
tags | ||
/.tool-versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lib/pg_search/migration/associated_against_tsvector_generator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require 'pg_search/migration/generator' | ||
|
||
module PgSearch | ||
module Migration | ||
class AssociatedAgainstTsvectorGenerator < Generator | ||
def migration_name | ||
'add_pg_search_associated_against_tsvector_support_functions'.freeze | ||
end | ||
end | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
...ch/migration/templates/add_pg_search_associated_against_tsvector_support_functions.rb.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class AddPgSearchAssociatedAgainstTsvectorSupportFunctions < ActiveRecord::Migration | ||
def self.up | ||
say_with_time("Adding tsvector support functions for pg_search :associated_against") do | ||
execute <<-'SQL' | ||
<%= read_sql_file "tsvector_agg" %> | ||
SQL | ||
end | ||
end | ||
|
||
def self.down | ||
say_with_time("Dropping tsvector support functions for pg_search :associated_against") do | ||
execute <<-'SQL' | ||
<%= read_sql_file "uninstall_tsvector_agg" %> | ||
SQL | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.