Sha256: 6695d61e279f25884b1c542c6004656ef31277c6f9cc15474ee1ee15d0f08931

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

    rails generate enable_tsearch <table> <context> <col1> <col2> ...

This assumes that you have already created a search_context using 'rails g search_context ...' and want to enable using that search_context from this related model.

This would generate the following

1. migration to add a context_vector column to table
2. migration to create a trigger that updates the context_vector column from <col1> <col2> ... whenever <table> is inserted or updated.

The migration to create the trigger is only an example, it'll work for simple cases but you'd need to edit it to create more complex and useful triggers, for example
if you needed to join to a remote table to get some columns from there.


  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
search_steroids-0.0.1 lib/generators/enable_tsearch/USAGE