Just wanted to check in once again to see if any DataMapper users had
come across this. Long story short, I would prefer not to query my 1:M
collection of abstractions via
Animal.last(:type=>"Elephant", :zookeeper_id => id).
For one thing, I don't see the need to iterate over the entire Animal
table when I can just query the associations in the Zookeeper
instance.
For another, I don't like that such a method call tightly couples my
code to the ORM implementation details--in other words, knowing that
the foreign key is called zookeeper_id is a detail I shouldn't have to
know about lest that changes for whatever reason.
The preferable thing would be something, given the object model
described in my previous message, like
zookeeper.animals.last(:type=>"Elephant") or
zookeeper.animals.last(:elephant) or some such.
Is this possible now? How have you solved this problem if you've
encountered it?
Thanks.