{"action":"created","issue":{"url":"https://api.github.com/repos/Casecommons/pg_search/issues/217","labels_url":"https://api.github.com/repos/Casecommons/pg_search/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/Casecommons/pg_search/issues/217/comments","events_url":"https://api.github.com/repos/Casecommons/pg_search/issues/217/events","html_url":"https://github.com/Casecommons/pg_search/issues/217","id":57191172,"number":217,"title":"update_pg_search_document is called even when nothing in the model has changed","user":{"login":"listenloop","id":7367606,"avatar_url":"https://avatars.githubusercontent.com/u/7367606?v=3","gravatar_id":"","url":"https://api.github.com/users/listenloop","html_url":"https://github.com/listenloop","followers_url":"https://api.github.com/users/listenloop/followers","following_url":"https://api.github.com/users/listenloop/following{/other_user}","gists_url":"https://api.github.com/users/listenloop/gists{/gist_id}","starred_url":"https://api.github.com/users/listenloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/listenloop/subscriptions","organizations_url":"https://api.github.com/users/listenloop/orgs","repos_url":"https://api.github.com/users/listenloop/repos","events_url":"https://api.github.com/users/listenloop/events{/privacy}","received_events_url":"https://api.github.com/users/listenloop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-10T15:41:05Z","updated_at":"2015-09-09T05:08:11Z","closed_at":null,"body":"after_save callback is called by rails even when nothing in the model has actually has changed. Below is what I mean:\r\n\r\nVisitor.first.update_attributes :name => \"x\" # fire after_save\r\nVisitor.first.update_attributes :name => \"x\" # again fires after_save\r\n\r\nNow, on the second update, where nothing really changed, `update_pg_search_document` is still called, which queries the `pg_search_documents` table.\r\n\r\nI believe we should not call  `update_pg_search_document` when nothing has changed in the model."},"comment":{"url":"https://api.github.com/repos/Casecommons/pg_search/issues/comments/138786142","html_url":"https://github.com/Casecommons/pg_search/issues/217#issuecomment-138786142","issue_url":"https://api.github.com/repos/Casecommons/pg_search/issues/217","id":138786142,"user":{"login":"amarshall","id":153175,"avatar_url":"https://avatars.githubusercontent.com/u/153175?v=3","gravatar_id":"","url":"https://api.github.com/users/amarshall","html_url":"https://github.com/amarshall","followers_url":"https://api.github.com/users/amarshall/followers","following_url":"https://api.github.com/users/amarshall/following{/other_user}","gists_url":"https://api.github.com/users/amarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/amarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarshall/subscriptions","organizations_url":"https://api.github.com/users/amarshall/orgs","repos_url":"https://api.github.com/users/amarshall/repos","events_url":"https://api.github.com/users/amarshall/events{/privacy}","received_events_url":"https://api.github.com/users/amarshall/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T05:08:10Z","updated_at":"2015-09-09T05:08:10Z","body":"Related: #160 "}}