Class: Autocomplete::ActsAsTaggableOn::TagsFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb

Constant Summary collapse

LIMIT =
20

Instance Method Summary collapse

Constructor Details

#initialize(params:) ⇒ TagsFinder

Returns a new instance of TagsFinder.


8
9
10
# File 'app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb', line 8

def initialize(params:)
  @params = params
end

Instance Method Details

#executeObject


12
13
14
15
16
# File 'app/finders/autocomplete/acts_as_taggable_on/tags_finder.rb', line 12

def execute
  tags = all_tags
  tags = filter_by_name(tags)
  limit(tags)
end