Skip to content

changed_attributes is deprecated in Rails 5.1 #714

Closed
@davedash

Description

@davedash

changed_attributes is deprecated in favor of saved_attributes.

When I updated my project to Rails 5.1 I started seeing this:

DEPRECATION WARNING: 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_funding_caches at...

The stack-trace included a reference to this:

https://github.com/elastic/elasticsearch-rails/blob/2.x/elasticsearch-model/lib/elasticsearch/model/proxy.rb#L65

I'm not sure how to cleanly resolve this without modifying elasticsearch-model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions