Rename Association#object_id to #xero_object_id to avoid shadowing Kernel#object_id#354
Rename Association#object_id to #xero_object_id to avoid shadowing Kernel#object_id#354peterc wants to merge 1 commit intoXeroAPI:masterfrom
Conversation
|
Hope this can get merged soon. |
|
Yes, let's get this merged in. Thanks Peter. |
|
Any chance to merge it soon? |
|
I have a feeling this change won't be accepted. It looks like most (if not all of) this code is generated from their OpenAPI Spec (https://github.com/XeroAPI/Xero-OpenAPI). I've found a similar PR adding |
Summary
object_idtoxero_object_idon theXeroRuby::Files::Associationmodel to avoid shadowingKernel#object_id, which is a core Ruby method that should never be overridden.ObjectId) is unchanged, so wire compatibility is preserved.FilesApiare unaffected (they useobject_idas a local parameter name, not a model accessor).Why this matters
Defining
attr_accessor :object_idon any Ruby object overridesKernel#object_id, which Ruby uses internally for object identity. This causes a warning (redefining 'object_id' may cause serious problems) and can lead to subtle bugs in equality checks, hash lookups, and debugging tools.