Skip to content

Conversation

@peterc
Copy link

@peterc peterc commented Jan 29, 2026

Summary

  • Renames object_id to xero_object_id on the XeroRuby::Files::Association model to avoid shadowing Kernel#object_id, which is a core Ruby method that should never be overridden.
  • The JSON serialization key (ObjectId) is unchanged, so wire compatibility is preserved.
  • API method signatures in FilesApi are unaffected (they use object_id as a local parameter name, not a model accessor).

Why this matters

Defining attr_accessor :object_id on any Ruby object overrides Kernel#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.

@peterc
Copy link
Author

peterc commented Jan 29, 2026

Fixes #327 and #348 BTW

@rept
Copy link

rept commented Feb 1, 2026

Hope this can get merged soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants