xero-ruby icon indicating copy to clipboard operation
xero-ruby copied to clipboard

Ruby 3.4.1 warns about redefining `object_id`

Open tubaxenor opened this issue 1 year ago • 9 comments

Version: 3.8.0

xero-ruby-3.8.0/lib/xero-ruby/models/files/association.rb:23: warning: redefining 'object_id' may cause serious problems

Also check current version (9.3.0), object_id still redefined in https://github.com/XeroAPI/xero-ruby/blob/master/lib/xero-ruby/models/files/association.rb#L32

Is there a plan to rename the attribute to be compatible with ruby 3.4?

tubaxenor avatar Jan 21 '25 05:01 tubaxenor

PETOSS-694

github-actions[bot] avatar Jan 21 '25 05:01 github-actions[bot]

Thanks for raising an issue, a ticket has been created to track your request

github-actions[bot] avatar Jan 21 '25 05:01 github-actions[bot]

are there any plans to resolve this?

dankimio avatar May 07 '25 11:05 dankimio

here's a temporary solution to mute warnings from xero-ruby:

# config/boot.rb

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

# TODO: remove this once the xero-ruby gem is updated
module Warning
  def self.warn(message)
    return if message.include?("xero-ruby")
    super(message)
  end
end

require "bundler/setup" # Set up gems listed in the Gemfile.

dankimio avatar May 07 '25 12:05 dankimio

Any update on this please?

armstrjare avatar May 13 '25 21:05 armstrjare

Yup, it's been annoying me for quite some time. At the same time, Xero is raising their pricing every six months as they know that so many people are simply locked to them.

StanBright avatar May 27 '25 23:05 StanBright

We were on a very old of this gem and updated finally; was disappointed to see this error still there.

wyardley avatar Jul 14 '25 23:07 wyardley

I think this gem must not be a focus for maintenance. I’m wondering if just using OAuth2 gem and hitting the API endpoints directly is a simpler solution these days.

armstrjare avatar Jul 14 '25 23:07 armstrjare

For supressing the warning this works a bit better, as technically Kernel.warn takes a splat as it's first argument, and can be given kwargs too:

module Warning
  def self.warn(*messages, **)
    return if messages.any? { |message| message.to_s.include?("xero-ruby") }
    super
  end
end

samstickland avatar Sep 12 '25 02:09 samstickland