Sha256: 60b091bf14491b43aaa7d5f31ae98f2225e81b1d606c3eddad9b4b5cf1f1bdc3
Contents?: true
Size: 563 Bytes
Versions: 1
Compression:
Stored size: 563 Bytes
Contents
# This model represents an entity that can be tagged with HaystackTags through HaystackTaggings. class Taggable < ApplicationRecord has_many :haystack_taggings, as: :taggable, dependent: :destroy has_many :haystack_tags, through: :haystack_taggings def add_haystack_marker(marker) self.tags ||= {} self.tags[marker] = true save! end def add_haystack_tag(key, value) self.tags ||= {} self.tags[key] = value save! end def add_multiple_tags(tags_hash) self.tags ||= {} self.tags.merge!(tags_hash) save! end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
needle_in_a_haystack-1.1.0 | lib/needle_in_a_haystack/concerns/taggable.rb |