Sha256: afb057b791e39e49a87c5a0899261932df7eac6bb29243b2082f03c8f031bbbc
Contents?: true
Size: 541 Bytes
Versions: 56
Compression:
Stored size: 541 Bytes
Contents
module Udongo::Search class Term attr_reader :controller, :string def initialize(string, controller: nil) @string = string @controller = controller end def locale return controller.locale if controller.present? Udongo.config.i18n.app.default_locale.to_sym end def synonym SearchSynonym.where(locale: locale) .where('concat(",", synonyms, ",") LIKE ?', "%,#{string},%") .take end def value return synonym.term if synonym string end end end
Version data entries
56 entries across 56 versions & 1 rubygems