Class: Writefully::Tag

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/writefully/tag.rb

Class Method Summary collapse

Class Method Details

.ids_from_tokens(tokens) ⇒ Object



9
10
11
12
13
14
# File 'app/models/writefully/tag.rb', line 9

def ids_from_tokens tokens
  taxon = Taxon.new(tokens, pluck(:name), name)

  import taxon.non_existing
  where(slug: tokens.map { |t| t.parameterize }).ids
end