Skip to content

Instantly share code, notes, and snippets.

@bryansray
Created July 28, 2008 20:43
Show Gist options
  • Save bryansray/2949 to your computer and use it in GitHub Desktop.
Save bryansray/2949 to your computer and use it in GitHub Desktop.
class MonitoredTopic
include DataMapper::Resource
property :id, Serial
belongs_to :user
belongs_to :topic
end
class Topic
include DataMapper::Resource
include DataMapper::Timestamp
has n, :monitored_topics
has n, :monitors, :through => :monitored_topics, :class_name => 'User'
end
class User
include DataMapper::Resource
include DataMapper::Validate
include DataMapper::Timestamp
has n, :monitored_topics
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment