Module: Noodall::Tagging::InstanceMethods

Defined in:
lib/noodall/tagging.rb

Instance Method Summary collapse

Instance Method Details



57
58
59
# File 'lib/noodall/tagging.rb', line 57

def related(options ={})
  self.class.all(options.merge({:_id => {'$ne' => self._id}, :tags => /(#{self.tags.join('|')})/i}))
end

#tag_listObject



53
54
55
# File 'lib/noodall/tagging.rb', line 53

def tag_list
  tags.join(', ')
end

#tag_list=(string) ⇒ Object



49
50
51
# File 'lib/noodall/tagging.rb', line 49

def tag_list=(string)
  self.tags = string.to_s.split(',').map{ |t| t.strip.downcase }.reject(&:blank?).compact.uniq
end