{"action":"created","issue":{"url":"https://api.github.com/repos/ScienceCommons/api/issues/221","labels_url":"https://api.github.com/repos/ScienceCommons/api/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/ScienceCommons/api/issues/221/comments","events_url":"https://api.github.com/repos/ScienceCommons/api/issues/221/events","html_url":"https://github.com/ScienceCommons/api/issues/221","id":95822393,"number":221,"title":"For recently updated/added articles on homepage, add user name and time of contribution","user":{"login":"eplebel","id":4512335,"avatar_url":"https://avatars.githubusercontent.com/u/4512335?v=3","gravatar_id":"","url":"https://api.github.com/users/eplebel","html_url":"https://github.com/eplebel","followers_url":"https://api.github.com/users/eplebel/followers","following_url":"https://api.github.com/users/eplebel/following{/other_user}","gists_url":"https://api.github.com/users/eplebel/gists{/gist_id}","starred_url":"https://api.github.com/users/eplebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eplebel/subscriptions","organizations_url":"https://api.github.com/users/eplebel/orgs","repos_url":"https://api.github.com/users/eplebel/repos","events_url":"https://api.github.com/users/eplebel/events{/privacy}","received_events_url":"https://api.github.com/users/eplebel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ScienceCommons/api/labels/public%20beta","name":"public beta","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-18T12:47:59Z","updated_at":"2015-08-23T20:21:15Z","closed_at":null,"body":"Add name of user who updated article and time of update in very small text below each of the Recently Added and Recently Updated articles. Mockup: \r\n![basic-homepage-enhancements](https://cloud.githubusercontent.com/assets/4512335/8761647/9dc84eae-2d29-11e5-9519-0ead2c0fda76.jpg)\r\n\r\nNotice the user name is bolded and the blue color of our color palette. In the case the contributing user is also an author in the system, the contributing user's name should be hyperlinked to that author's page (e.g., if user \"Brent Donnellan\" updated an article, clicking on his hyperlinked user name should bring you to that user's author page, i.e., https://www.curatescience.org/beta/#/authors/54). In the case a contributing user is *not* yet an author in the system, the user name should not be hyperlinked (though eventually such user names should be hyperlinked to their user profile page; this isn't yet possible because user profile pages aren't yet publicly exposed)."},"comment":{"url":"https://api.github.com/repos/ScienceCommons/api/issues/comments/133921241","html_url":"https://github.com/ScienceCommons/api/issues/221#issuecomment-133921241","issue_url":"https://api.github.com/repos/ScienceCommons/api/issues/221","id":133921241,"user":{"login":"alexkyllo","id":2609312,"avatar_url":"https://avatars.githubusercontent.com/u/2609312?v=3","gravatar_id":"","url":"https://api.github.com/users/alexkyllo","html_url":"https://github.com/alexkyllo","followers_url":"https://api.github.com/users/alexkyllo/followers","following_url":"https://api.github.com/users/alexkyllo/following{/other_user}","gists_url":"https://api.github.com/users/alexkyllo/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkyllo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkyllo/subscriptions","organizations_url":"https://api.github.com/users/alexkyllo/orgs","repos_url":"https://api.github.com/users/alexkyllo/repos","events_url":"https://api.github.com/users/alexkyllo/events{/privacy}","received_events_url":"https://api.github.com/users/alexkyllo/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T20:21:15Z","updated_at":"2015-08-23T20:21:15Z","body":"Adding a comment, study, or replication updates the parent article's `updated_at` date but does not create a `ModelUpdate` record. There are no ModelUpdates at the Comment, Replication, or Link level. The only models that record `ModelUpdate`s are `Author`, `Article` and `Study`.\r\n\r\nThe API is sending the `Article` model's `updated_at` date which will be updated anytime a child study or replication is updated, because of the `touch: true` lines in the `Study` and `Replication` models:\r\nhttps://github.com/ScienceCommons/api/blob/master/app/models/study.rb#L12\r\nhttps://github.com/ScienceCommons/api/blob/master/app/models/replication.rb#L7\r\nIt's also updating the `Article` model's `updated_at` date when a `Comment` is added because this line is updating the `Article`'s `comment_count`:\r\nhttps://github.com/ScienceCommons/api/blob/master/app/models/comment.rb#L22\r\n\r\nSo the landing page is showing the time of the last update to any child comment, study or replication under the article, but it's showing the name of the user who submitted the last `ModelUpdate` for the `Article` itself. That's why it's showing your name even though another user added a replication.\r\n\r\nWe could start recording `ModelUpdate` records for `Comment`, `Replication` and `Link`, and query for the name of the person who last submitted a `ModelUpdate` for any `Study`, `Author`, `Comment`, `Replication` or `Link` associated with the `Article`. I am worried about the performance of this query though, since the landing page already loads pretty slow. "}}