Module: SequelRelation

Defined in:
lib/ramaze/contrib/sequel/relation.rb

Overview

Pretty DSL to express Sequel relations

Usage:

SequelRelation.relations do
the User do
  has_many Article
  has_one Avatar
end

the Article do
  belongs_to User
end

the Avatar do
  belongs_to User
end
end

Defined Under Namespace

Classes: RelationshipManager

Class Method Summary collapse

Class Method Details

.relations(&block) ⇒ Object



23
24
25
26
# File 'lib/ramaze/contrib/sequel/relation.rb', line 23

def self.relations(&block)
  rema = RelationshipManager.new(&block)
  rema.finalize
end