Sorry for the delayed response - those changes all look cool, dig it.
I did have one question, though - won't this section in
remove_associated_object force another DB lookup if you pass in an
object?
+ elsif send(opts.dataset_method).filter(o.pk_hash).empty?
+ raise(Sequel::Error, "associated object #{o.inspect} is
not currently associated to #{inspect}")
+ end
So doing:
player = Player[1]
game = Game[2]
game.remove_player(player)
Would result in two fetches?
select * from players where id = 1
select * from players where game_id = 2 and id = 1 # to check
assoc
If so (assuming there's not caching I'm unaware of), is there a way to
do that without the fetch? Is there a member method that would return
the FK?
+ elsif send(o.fk_hash_for(self)) != pk
+ raise(Sequel::Error, "associated object #{o.inspect} is
not currently associated to #{inspect}")
+ end
(Obviously that's non-working code but hopefully the idea is clear)
-Nate
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---