Sha256: 8d713b11b2f00ea84d01155a732b293edec93fa78afaac5938cf15b11a6bd03e
Contents?: true
Size: 461 Bytes
Versions: 16
Compression:
Stored size: 461 Bytes
Contents
module Highrise module Taggable def tags self.get(:tags) end def tag!(tag_name) self.post(:tags, :name => tag_name) unless tag_name.blank? end def untag!(tag_name) to_delete = self.tags.find{|tag| tag['name'] == tag_name} unless tag_name.blank? self.untag_id!(to_delete['id']) unless to_delete.nil? end protected def untag_id!(tag_id) self.delete("tags/#{tag_id}") end end end
Version data entries
16 entries across 16 versions & 2 rubygems