{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/28594","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/28594/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/28594/comments","events_url":"https://api.github.com/repos/rails/rails/issues/28594/events","html_url":"https://github.com/rails/rails/issues/28594","id":217807251,"number":28594,"title":"Getting attribute_changed? deprecation warning in a place that's not deprecated in Rails 5.1.0.rc1","user":{"login":"hult","id":374824,"avatar_url":"https://avatars0.githubusercontent.com/u/374824?v=3","gravatar_id":"","url":"https://api.github.com/users/hult","html_url":"https://github.com/hult","followers_url":"https://api.github.com/users/hult/followers","following_url":"https://api.github.com/users/hult/following{/other_user}","gists_url":"https://api.github.com/users/hult/gists{/gist_id}","starred_url":"https://api.github.com/users/hult/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hult/subscriptions","organizations_url":"https://api.github.com/users/hult/orgs","repos_url":"https://api.github.com/users/hult/repos","events_url":"https://api.github.com/users/hult/events{/privacy}","received_events_url":"https://api.github.com/users/hult/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-03-29T08:53:23Z","updated_at":"2017-03-29T14:17:29Z","closed_at":null,"body":"### Steps to reproduce\r\nIn a model, call `attribute_changed?` from the condition of a `validate` callback.\r\n\r\n```ruby\r\nclass MyModel\r\n  validate :name_is_valid, if: lambda { |obj| obj.name_changed? }\r\nend\r\n```\r\n\r\n### Expected behavior\r\nI expect this to work without deprecation warnings.\r\n\r\n### Actual behavior\r\nI'm getting a deprecation warning that suggest the behavior of `attribute_changed?` changed from inside after callbacks, but this is not inside one (I could of course not use the deprecation warning's suggested fix of changing to `saved_change_to_attribute?` since it's not saved yet).\r\n\r\n> DEPRECATION WARNING: 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 block in <class:MyModel> at /Users/magnus/Code/rails_test/api/app/models/my_model.rb:2)\r\n\r\n\r\n### System configuration\r\n**Rails version**: 5.1.0.rc1\r\n\r\n**Ruby version**: 2.4.1\r\n"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/290104106","html_url":"https://github.com/rails/rails/issues/28594#issuecomment-290104106","issue_url":"https://api.github.com/repos/rails/rails/issues/28594","id":290104106,"user":{"login":"fillman","id":43970,"avatar_url":"https://avatars1.githubusercontent.com/u/43970?v=3","gravatar_id":"","url":"https://api.github.com/users/fillman","html_url":"https://github.com/fillman","followers_url":"https://api.github.com/users/fillman/followers","following_url":"https://api.github.com/users/fillman/following{/other_user}","gists_url":"https://api.github.com/users/fillman/gists{/gist_id}","starred_url":"https://api.github.com/users/fillman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillman/subscriptions","organizations_url":"https://api.github.com/users/fillman/orgs","repos_url":"https://api.github.com/users/fillman/repos","events_url":"https://api.github.com/users/fillman/events{/privacy}","received_events_url":"https://api.github.com/users/fillman/received_events","type":"User","site_admin":false},"created_at":"2017-03-29T14:17:29Z","updated_at":"2017-03-29T14:17:29Z","body":"Anyway, I suggest you either modify this issue, or close and create new one, with steps to reproduce, so someone can fix it. Good luck @hult!"}}
{"actor":{"display_login":"fillman"}}