Skip to content

Instantly share code, notes, and snippets.

@voidlock voidlock/snippet.rb
Created May 22, 2009

Embed
What would you like to do?
class Photo
include DataMapper::Resource
has n, :taggings
has n, :tags, :through => :taggings, 'taggings.deleted_at' => nil
end
class Tag
include DataMapper::Resource
has n, :taggings
has n, :photos, :through => :taggings
end
class Tagging
include DataMapper::Resource
property :deleted_at, ParanoidDateTime
belongs_to :tag
belongs_to :photo
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.