registry icon indicating copy to clipboard operation
registry copied to clipboard

Resolve deprecation warnings

Open vohmar opened this issue 5 years ago • 3 comments

There are very many deprecation warnings returned during deployment clogging the logs. Let get rid of these.

Current master build: https://travis-ci.org/internetee/registry/builds/647285407

  • [x] /home/travis/build/internetee/registry/app/models/payment_orders/bank_link.rb:92: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
  • [x] The behavior of changed_attributes inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after save returned (e.g. the opposite of what it returns now). To maintain the current behavior, use saved_changes.transform_values(&:first) instead. (called from update_related_whois_records at /home/travis/build/internetee/registry/app/models/contact.rb:487)
  • [x] The behavior of changes inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after save returned (e.g. the opposite of what it returns now). To maintain the current behavior, use saved_changes instead. (called from update_related_whois_records at /home/travis/build/internetee/registry/app/models/contact.rb:487)
  • [x] The behavior of changed inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after save returned (e.g. the opposite of what it returns now). To maintain the current behavior, use saved_changes.keys instead. (called from update_related_whois_records at /home/travis/build/internetee/registry/app/models/contact.rb:487)
  • [x] The behavior of attribute_change inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after save returned (e.g. the opposite of what it returns now). To maintain the current behavior, use saved_change_to_attribute instead. (called from update_related_whois_records at /home/travis/build/internetee/registry/app/models/contact.rb:487)
  • [x] The behavior of attribute_changed? inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after save returned (e.g. the opposite of what it returns now). To maintain the current behavior, use saved_change_to_attribute? instead. (called from update_related_whois_records at /home/travis/build/internetee/registry/app/models/contact.rb:487)

vohmar avatar Feb 07 '20 12:02 vohmar

The main bunch of changed deprecated warnings comes form the papertrail gem - so we need either pump it's version to latest (requires some refactoring due to papertrail API changes) or get rid of it completely.

yulgolem avatar Feb 07 '20 13:02 yulgolem

Getting rid of papertrail is not possible at the moment because we have nothing to replace it with. So refactoring it is unless it's multi-day undertaking

vohmar avatar Feb 07 '20 13:02 vohmar

The refactoring will take from a couple of hours to a couple of days. But I've silenced them by setting config.active_support.deprecation = :silence in config/environments/test.rb. Note - they are not resolved, just silenced. Courtesy of https://github.com/internetee/registry/pull/1522

yulgolem avatar Feb 07 '20 13:02 yulgolem