Module: PgSearchable::ActiveRecord::Extensions::ClassMethods
- Defined in:
- lib/pg_searchable/active_record/extensions.rb
Instance Method Summary collapse
- #pg_searchable(name, options = {}) ⇒ Object
- #pg_searchable_configs ⇒ Object
- #search_for(term, options = {}) ⇒ Object
Instance Method Details
#pg_searchable(name, options = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/pg_searchable/active_record/extensions.rb', line 14 def pg_searchable (name, = {}) pg_searchable_configs[name.to_sym] = { tgrm: , dmetaphone: , tsearch: }.deep_merge() end |
#pg_searchable_configs ⇒ Object
22 23 24 |
# File 'lib/pg_searchable/active_record/extensions.rb', line 22 def pg_searchable_configs @pg_searchable_configs ||= {} end |
#search_for(term, options = {}) ⇒ Object
26 27 28 |
# File 'lib/pg_searchable/active_record/extensions.rb', line 26 def search_for(term, = {}) scoped.search_for(term, ) end |