Module: Mongoid::Document::Taggable::InstanceMethods

Defined in:
lib/workarea/ext/freedom_patches/mongoid_simple_tags.rb

Instance Method Summary collapse

Instance Method Details

#tag_listObject



22
23
24
# File 'lib/workarea/ext/freedom_patches/mongoid_simple_tags.rb', line 22

def tag_list
  self.tags.join(", ") if tags
end

#tag_list=(tags) ⇒ Object



18
19
20
# File 'lib/workarea/ext/freedom_patches/mongoid_simple_tags.rb', line 18

def tag_list=(tags)
  self.tags = tags.to_s.split(",").collect { |t| t.strip }.delete_if { |t| t.blank? }
end

#tagsObject



26
27
28
# File 'lib/workarea/ext/freedom_patches/mongoid_simple_tags.rb', line 26

def tags
  super || []
end

#tags=(tags) ⇒ Object



30
31
32
# File 'lib/workarea/ext/freedom_patches/mongoid_simple_tags.rb', line 30

def tags=(tags)
  super(tags&.uniq)
end