Class: Decidim::HashtagsResolver

Inherits:
Object
  • Object
show all
Defined in:
app/resolvers/decidim/hashtags_resolver.rb

Overview

A GraphQL resolver to handle ‘hashtags’

Instance Method Summary collapse

Constructor Details

#initialize(organization, term) ⇒ HashtagsResolver

Returns a new instance of HashtagsResolver.



6
7
8
9
# File 'app/resolvers/decidim/hashtags_resolver.rb', line 6

def initialize(organization, term)
  @organization = organization
  @term = term
end

Instance Method Details

#hashtagsObject



11
12
13
# File 'app/resolvers/decidim/hashtags_resolver.rb', line 11

def hashtags
  Decidim::Hashtag.where(organization: @organization).where("name like ?", "#{@term}%")
end