Class: OntologyTagStrategy

Inherits:
TagStrategy show all
Defined in:
lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb

Instance Method Summary collapse

Instance Method Details

#create_tag(name, description) ⇒ Object



2
3
4
5
6
# File 'lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb', line 2

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

#update_tag(tag, attributes) ⇒ Object



8
9
10
# File 'lib/needle_in_a_haystack/strategies/ontology_tag_strategy.rb', line 8

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