Ruby 2.5 deprecation message

460 Views Asked by At

Ruby 2.5 deprecated the Data class and we have three classes in Rails that are named after Data::. This gave us deprecation warnings every time this runs. What's the best way to handle such deprecation? Should we rename our class or is there a better solution?

1

There are 1 best solutions below

0
Joel Blum On

maybe define your class inside the silence block ?

ActiveSupport::Deprecation.silence do 
   class Data
   end
end

https://api.rubyonrails.org/classes/ActiveSupport/Deprecation/Reporting.html#method-i-silence