Ruby 3.4.1 warns about redefining `object_id`
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?
PETOSS-694
Thanks for raising an issue, a ticket has been created to track your request
are there any plans to resolve this?
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.
Any update on this please?
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.
We were on a very old of this gem and updated finally; was disappointed to see this error still there.
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.
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