On Oct 19, 11:38 am, Nate Wiger <[email protected]> wrote:
> Truthfully I will be using the integer form in any cases I can think
> of, hence the reason I wanted it :-)
>
>   game = Game[2]
>   game.remove_player(1)
>
> I did think of having to deal with composite keys, so if there's not a
> built-in == override to pk == fk already, then it's not worth messing
> with like you said.

Maybe factoring it out into a separate method that's easier to
override will be helpful anyway.  Then for your purposes, you could
just override the method in Sequel::Model to do something like:

  def one_to_many_is_currently_associated?(opts, o)
    o.send(opts[:key]).to_i == send(opts[:primary_key]).to_i
  end

That implementation won't work for the general case, but it will be
faster for you if it meets your needs.  If that's something you're
interested in, just send in a patch.

> In terms of the performance vs reliability, just FYI one of the
> reasons I'm liking Sequel is the perf is better than AR, esp with
> associations :-)

That's good to know. :)

Jeremy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to