{"action":"created","issue":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/92","labels_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/92/comments","events_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/92/events","html_url":"https://github.com/phatworx/devise_security_extension/pull/92","id":39139487,"number":92,"title":"Avoid saving unvalidated fields","user":{"login":"avit","id":4278,"avatar_url":"https://avatars.githubusercontent.com/u/4278?v=3","gravatar_id":"","url":"https://api.github.com/users/avit","html_url":"https://github.com/avit","followers_url":"https://api.github.com/users/avit/followers","following_url":"https://api.github.com/users/avit/following{/other_user}","gists_url":"https://api.github.com/users/avit/gists{/gist_id}","starred_url":"https://api.github.com/users/avit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avit/subscriptions","organizations_url":"https://api.github.com/users/avit/orgs","repos_url":"https://api.github.com/users/avit/repos","events_url":"https://api.github.com/users/avit/events{/privacy}","received_events_url":"https://api.github.com/users/avit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-07-30T21:32:42Z","updated_at":"2015-09-28T23:11:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/pulls/92","html_url":"https://github.com/phatworx/devise_security_extension/pull/92","diff_url":"https://github.com/phatworx/devise_security_extension/pull/92.diff","patch_url":"https://github.com/phatworx/devise_security_extension/pull/92.patch"},"body":"If there are any assigned attributes that are invalid, they should not be saved without validation.\r\n\r\nThis change saves only the DeviseSecurityExtension fields to prevent things like this:\r\n\r\n```ruby\r\nuser.assign_attributes(email: \"\") # bad input\r\nuser.need_change_password! # would save whole model, bad input without validation\r\n```\r\n\r\nAlso it looks like there was a recursive loop inside `need_change_password` which I removed: please check if this is correct unless I missed what that was supposed to do."},"comment":{"url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/comments/143898648","html_url":"https://github.com/phatworx/devise_security_extension/pull/92#issuecomment-143898648","issue_url":"https://api.github.com/repos/phatworx/devise_security_extension/issues/92","id":143898648,"user":{"login":"avit","id":4278,"avatar_url":"https://avatars.githubusercontent.com/u/4278?v=3","gravatar_id":"","url":"https://api.github.com/users/avit","html_url":"https://github.com/avit","followers_url":"https://api.github.com/users/avit/followers","following_url":"https://api.github.com/users/avit/following{/other_user}","gists_url":"https://api.github.com/users/avit/gists{/gist_id}","starred_url":"https://api.github.com/users/avit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avit/subscriptions","organizations_url":"https://api.github.com/users/avit/orgs","repos_url":"https://api.github.com/users/avit/repos","events_url":"https://api.github.com/users/avit/events{/privacy}","received_events_url":"https://api.github.com/users/avit/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T23:11:45Z","updated_at":"2015-09-28T23:11:45Z","body":"Sorry I missed your comment here from April... If this is still relevant I can add tests and rebase.\r\n\r\nAbout your anti-pattern note, I was not changing the existing implementation: I can change it to `respond_to?(:ago)` but I don't think that would be any clearer... do you have a better suggestion for this?\r\n"}}