Sha256: 95c77a0350c76274cb9a0543d49d8163cea1df7027a5dbf79d8486677563b3f6

Contents?: true

Size: 424 Bytes

Versions: 2

Compression:

Stored size: 424 Bytes

Contents

class Tagging
  include DataMapper::Resource
  property :id, Integer, :serial => true
  property :tag_id, Integer, :nullable => false
  property :taggable_id, Integer, :nullable => false
  property :taggable_type, String, :nullable => false
  property :tag_context, String, :nullable => false
  
  belongs_to :tag
  
  def taggable
    eval("#{taggable_type}.get!(#{taggable_id})") if taggable_type and taggable_id
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-tags-0.0.2 lib/dm-tags/tagging.rb
dm-tags-0.0.3 lib/dm-tags/tagging.rb