Sha256: 0456936d640c8e894c030a102137746398cdd63202fd5e1ea11cf7993a597fe1

Contents?: true

Size: 430 Bytes

Versions: 8

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

class Gutentag::TaggedWith::NameQuery < Gutentag::TaggedWith::Query
  def initialize(model, values, match)
    super

    @values = @values.collect { |tag| Gutentag.normaliser.call(tag) }
  end

  private

  def taggable_ids_query
    Gutentag::Tagging.joins(:tag).select(:taggable_id).
      where(:taggable_type => model.name).
      where(Gutentag::Tag.table_name => {:name => values})
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gutentag-2.3.1 lib/gutentag/tagged_with/name_query.rb
gutentag-2.3.0 lib/gutentag/tagged_with/name_query.rb
gutentag-2.2.1 lib/gutentag/tagged_with/name_query.rb
gutentag-2.2.0 lib/gutentag/tagged_with/name_query.rb
gutentag-2.1.0 lib/gutentag/tagged_with/name_query.rb
gutentag-2.0.0 lib/gutentag/tagged_with/name_query.rb
gutentag-1.1.0 lib/gutentag/tagged_with/name_query.rb
gutentag-1.0.0 lib/gutentag/tagged_with/name_query.rb