module Fuzzily::Searchable::Rails5ClassMethods

Private Instance Methods

_add_trigram_association(_o) click to toggle source
# File lib/fuzzily/searchable.rb, line 159
def _add_trigram_association(_o)
  has_many _o.trigram_association,
    lambda { where(fuzzy_field: _o.field.to_s) },
    class_name: _o.trigram_class_name,
    as:         :owner,
    dependent:  :delete_all,
    autosave:   true
end
_with_included_trigrams(_o) click to toggle source
# File lib/fuzzily/searchable.rb, line 168
def _with_included_trigrams(_o)
  self.includes(_o.trigram_association)
end