Skip to content

Instantly share code, notes, and snippets.

@fgrehm fgrehm/gist:212121
Created Oct 16, 2009

Embed
What would you like to do?
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
You can’t perform that action at this time.