{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/154831833","pull_request_review_id":81053721,"id":154831833,"diff_hunk":"@@ -11,13 +9,17 @@ def class_from_resource(resource_name)\n       resource_name.to_s.classify.constantize\n     end\n \n-    def display_resource_name(resource_name)\n-      class_from_resource(resource_name).\n-        model_name.\n-        human(\n-          count: PLURAL_MANY_COUNT,\n-          default: resource_name.to_s.pluralize.titleize,\n-        )\n+    def display_resource_name(resource_name, count: :other)\n+      resource_string = resource_name.to_s\n+      count_method = { many: :pluralize, other: :pluralize, one: :singularize }\n+\n+      I18n.t(\n+        \"activerecord.models.#{resource_string.singularize}.#{count}\",\n+        default: [\n+          \"administrate.resources.#{resource_string.pluralize}.#{count}\".to_sym,\n+          resource_string.send(count_method[count.to_sym]).titleize","path":"app/helpers/administrate/application_helper.rb","position":27,"original_position":27,"commit_id":"9e964b522bada0e6177ef4a04a215670434fd233","original_commit_id":"9e964b522bada0e6177ef4a04a215670434fd233","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Put a comma after the last item of a multiline array.","created_at":"2017-12-05T02:23:12Z","updated_at":"2017-12-05T02:23:12Z","html_url":"https://github.com/thoughtbot/administrate/pull/1043#discussion_r154831833","pull_request_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments/154831833"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/1043#discussion_r154831833"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043","id":156356804,"html_url":"https://github.com/thoughtbot/administrate/pull/1043","diff_url":"https://github.com/thoughtbot/administrate/pull/1043.diff","patch_url":"https://github.com/thoughtbot/administrate/pull/1043.patch","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/1043","number":1043,"state":"open","locked":false,"title":"Use I18n to display resource name","user":{"login":"shvetsovdm","id":3574904,"avatar_url":"https://avatars2.githubusercontent.com/u/3574904?v=4","gravatar_id":"","url":"https://api.github.com/users/shvetsovdm","html_url":"https://github.com/shvetsovdm","followers_url":"https://api.github.com/users/shvetsovdm/followers","following_url":"https://api.github.com/users/shvetsovdm/following{/other_user}","gists_url":"https://api.github.com/users/shvetsovdm/gists{/gist_id}","starred_url":"https://api.github.com/users/shvetsovdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shvetsovdm/subscriptions","organizations_url":"https://api.github.com/users/shvetsovdm/orgs","repos_url":"https://api.github.com/users/shvetsovdm/repos","events_url":"https://api.github.com/users/shvetsovdm/events{/privacy}","received_events_url":"https://api.github.com/users/shvetsovdm/received_events","type":"User","site_admin":false},"body":"This will allow to create custom dashboard pages without an ActiveRecord model. Like in this issue: https://github.com/thoughtbot/administrate/issues/186#issuecomment-259535180","created_at":"2017-12-05T02:23:01Z","updated_at":"2017-12-05T02:23:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9a753d80b5a14dc3aa33e63fb113e7810ab9fcb","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/1043/comments","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/9e964b522bada0e6177ef4a04a215670434fd233","head":{"label":"farpostdesign:i18n_display_resource_name","ref":"i18n_display_resource_name","sha":"9e964b522bada0e6177ef4a04a215670434fd233","user":{"login":"farpostdesign","id":9072801,"avatar_url":"https://avatars1.githubusercontent.com/u/9072801?v=4","gravatar_id":"","url":"https://api.github.com/users/farpostdesign","html_url":"https://github.com/farpostdesign","followers_url":"https://api.github.com/users/farpostdesign/followers","following_url":"https://api.github.com/users/farpostdesign/following{/other_user}","gists_url":"https://api.github.com/users/farpostdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/farpostdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farpostdesign/subscriptions","organizations_url":"https://api.github.com/users/farpostdesign/orgs","repos_url":"https://api.github.com/users/farpostdesign/repos","events_url":"https://api.github.com/users/farpostdesign/events{/privacy}","received_events_url":"https://api.github.com/users/farpostdesign/received_events","type":"Organization","site_admin":false},"repo":{"id":72846522,"name":"administrate","full_name":"farpostdesign/administrate","owner":{"login":"farpostdesign","id":9072801,"avatar_url":"https://avatars1.githubusercontent.com/u/9072801?v=4","gravatar_id":"","url":"https://api.github.com/users/farpostdesign","html_url":"https://github.com/farpostdesign","followers_url":"https://api.github.com/users/farpostdesign/followers","following_url":"https://api.github.com/users/farpostdesign/following{/other_user}","gists_url":"https://api.github.com/users/farpostdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/farpostdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farpostdesign/subscriptions","organizations_url":"https://api.github.com/users/farpostdesign/orgs","repos_url":"https://api.github.com/users/farpostdesign/repos","events_url":"https://api.github.com/users/farpostdesign/events{/privacy}","received_events_url":"https://api.github.com/users/farpostdesign/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/farpostdesign/administrate","description":"A Rails engine that helps you put together a super-flexible admin dashboard.","fork":true,"url":"https://api.github.com/repos/farpostdesign/administrate","forks_url":"https://api.github.com/repos/farpostdesign/administrate/forks","keys_url":"https://api.github.com/repos/farpostdesign/administrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/farpostdesign/administrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/farpostdesign/administrate/teams","hooks_url":"https://api.github.com/repos/farpostdesign/administrate/hooks","issue_events_url":"https://api.github.com/repos/farpostdesign/administrate/issues/events{/number}","events_url":"https://api.github.com/repos/farpostdesign/administrate/events","assignees_url":"https://api.github.com/repos/farpostdesign/administrate/assignees{/user}","branches_url":"https://api.github.com/repos/farpostdesign/administrate/branches{/branch}","tags_url":"https://api.github.com/repos/farpostdesign/administrate/tags","blobs_url":"https://api.github.com/repos/farpostdesign/administrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/farpostdesign/administrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/farpostdesign/administrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/farpostdesign/administrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/farpostdesign/administrate/statuses/{sha}","languages_url":"https://api.github.com/repos/farpostdesign/administrate/languages","stargazers_url":"https://api.github.com/repos/farpostdesign/administrate/stargazers","contributors_url":"https://api.github.com/repos/farpostdesign/administrate/contributors","subscribers_url":"https://api.github.com/repos/farpostdesign/administrate/subscribers","subscription_url":"https://api.github.com/repos/farpostdesign/administrate/subscription","commits_url":"https://api.github.com/repos/farpostdesign/administrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/farpostdesign/administrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/farpostdesign/administrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/farpostdesign/administrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/farpostdesign/administrate/contents/{+path}","compare_url":"https://api.github.com/repos/farpostdesign/administrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/farpostdesign/administrate/merges","archive_url":"https://api.github.com/repos/farpostdesign/administrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/farpostdesign/administrate/downloads","issues_url":"https://api.github.com/repos/farpostdesign/administrate/issues{/number}","pulls_url":"https://api.github.com/repos/farpostdesign/administrate/pulls{/number}","milestones_url":"https://api.github.com/repos/farpostdesign/administrate/milestones{/number}","notifications_url":"https://api.github.com/repos/farpostdesign/administrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/farpostdesign/administrate/labels{/name}","releases_url":"https://api.github.com/repos/farpostdesign/administrate/releases{/id}","deployments_url":"https://api.github.com/repos/farpostdesign/administrate/deployments","created_at":"2016-11-04T12:38:46Z","updated_at":"2016-11-04T12:38:47Z","pushed_at":"2017-12-05T02:20:34Z","git_url":"git://github.com/farpostdesign/administrate.git","ssh_url":"git@github.com:farpostdesign/administrate.git","clone_url":"https://github.com/farpostdesign/administrate.git","svn_url":"https://github.com/farpostdesign/administrate","homepage":"http://administrate-prototype.herokuapp.com/admin","size":1176,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"6661889711edd688c8768e48602fa4a25b82d7bf","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":33739333,"name":"administrate","full_name":"thoughtbot/administrate","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars3.githubusercontent.com/u/6183?v=4","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/administrate","description":"A Rails engine that helps you put together a super-flexible admin dashboard.","fork":false,"url":"https://api.github.com/repos/thoughtbot/administrate","forks_url":"https://api.github.com/repos/thoughtbot/administrate/forks","keys_url":"https://api.github.com/repos/thoughtbot/administrate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/administrate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/administrate/teams","hooks_url":"https://api.github.com/repos/thoughtbot/administrate/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/administrate/events","assignees_url":"https://api.github.com/repos/thoughtbot/administrate/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/administrate/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/administrate/tags","blobs_url":"https://api.github.com/repos/thoughtbot/administrate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/administrate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/administrate/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/administrate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/administrate/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/administrate/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/administrate/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/administrate/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/administrate/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/administrate/subscription","commits_url":"https://api.github.com/repos/thoughtbot/administrate/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/administrate/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/administrate/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/administrate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/administrate/merges","archive_url":"https://api.github.com/repos/thoughtbot/administrate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/administrate/downloads","issues_url":"https://api.github.com/repos/thoughtbot/administrate/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/administrate/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/administrate/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/administrate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/administrate/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/administrate/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/administrate/deployments","created_at":"2015-04-10T16:43:02Z","updated_at":"2017-12-04T17:24:01Z","pushed_at":"2017-12-05T02:23:02Z","git_url":"git://github.com/thoughtbot/administrate.git","ssh_url":"git@github.com:thoughtbot/administrate.git","clone_url":"https://github.com/thoughtbot/administrate.git","svn_url":"https://github.com/thoughtbot/administrate","homepage":"http://administrate-prototype.herokuapp.com/admin","size":1152,"stargazers_count":3649,"watchers_count":3649,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":588,"mirror_url":null,"archived":false,"open_issues_count":164,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":588,"open_issues":164,"watchers":3649,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043"},"html":{"href":"https://github.com/thoughtbot/administrate/pull/1043"},"issue":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/1043"},"comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/issues/1043/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/administrate/pulls/1043/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/administrate/statuses/9e964b522bada0e6177ef4a04a215670434fd233"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houndci-bot"}}