Created
October 16, 2009 22:28
-
-
Save fgrehm/212121 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orm.map(Exhibit, "exhibits") do |exhibits, type| | |
exhibits.field :id, type.serial | |
exhibits.field :name, type.string(200) | |
exhibits.field :zoo_id, type.integer | |
exhibits.key :id | |
end | |
orm.map(ZooKeeper, 'zoo_keepers') do |zoo_keepers, type| | |
zoo_keepers.field :id, type.serial | |
zoo_keepers.field :name, type.string(200) | |
zoo_keepers.key :id | |
zoo_keepers.many_to_many(:exhibits, Exhibit, 'exhibits_zoo_keepers') | |
end | |
# this is what i thought for ManyToMany#load but there's no relation between Exhibits -> ZooKeeper | |
# only Exhibits <- ZooKeeper | |
orm.all(Exhibits) do |exhibits| | |
exhibits.zoo_keepers.id.eq(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment