Sha256: fd397ec4bdb36e6c5dc1f4de2d23391efa6607737705c6281f7702d8fed5d25c

Contents?: true

Size: 264 Bytes

Versions: 5

Compression:

Stored size: 264 Bytes

Contents

class OntologyTagStrategy < TagStrategy
  def create_tag(name, description)
    HaystackTag.find_or_create_by(name: name).tap do |tag|
      tag.update(description: description)
    end
  end

  def update_tag(tag, attributes)
    tag.update(attributes)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
needle_in_a_haystack-1.1.0 lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb
needle_in_a_haystack-1.0.8 lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb
needle_in_a_haystack-1.0.7 lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb
needle_in_a_haystack-1.0.6 lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb
needle_in_a_haystack-1.0.5 lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb