Why not aliasing methods in your custom code only? I never used the id method. Why would you use it for? On Jul 11, 2014 9:42 PM, "Rodrigo Rosenfeld Rosas" <[email protected]> wrote:
> I understand that this could be desired in an era where Ruby used to > define Object#id, but currently I'd prefer my models to raise a > NoMethodError if someone tries to acess #id from a model where the primary > key has another name instead of simply returning nil. Fail-fast is a good > strategy to prevent errors as soon as possible. > > Having said that, can you foresee any problems with something like: > > class MyModel < Sequel::Model > set_primary_key :another_id > undef_method :id > end > > Could that cause any troubles? > > -- > You received this message because you are subscribed to the Google Groups > "sequel-talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sequel-talk. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
