Skip to content

Instantly share code, notes, and snippets.

@pedro

pedro/gist:176634

Created Aug 27, 2009
Embed
What would you like to do?
class Post < Sequel::Model
one_to_many :taggings
many_to_many :tags, :join_table => :taggings
end
class Tag < Sequel::Model
one_to_many :taggings
end
class Tagging < Sequel::Model
many_to_one :tag
many_to_one :post
end
# >> Post.new.tags
# Sequel::Error: model object Post does not have a primary key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment