{"action":"created","comment":{"url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/comments/57109685","id":57109685,"diff_hunk":"@@ -172,4 +172,64 @@ def test_error_raised_when_states_are_duplicated_with_normal_enum_entry\n       end\n     end\n   end\n+\n+  if Rails::VERSION::STRING >= '5'\n+    def test_enum_definition_with_prefix\n+      ActiveRecord::Migration.create_table(:enum_prefix_test) do |t|\n+        t.integer :status\n+        t.integer :comments_status\n+      end\n+      tes = Class.new(ActiveRecord::Base) do\n+        self.table_name = 'enum_prefix_test'\n+        enum(status: [:active, :archived], _prefix: true) { event(:archive) { transition(active: :archived) } }\n+        enum(comments_status: [:active, :inactive], _prefix: :comments) { event(:close) { transition(active: :inactive) } }\n+      end.new status: :active, comments_status: :active\n+\n+      assert({ active: :archived }, tes.status_archive_transition)","path":"test/mechanic_machine_test.rb","position":17,"original_position":17,"commit_id":"2592513ab4fefe2e57da3122e3a6eda7a3bbe4ac","original_commit_id":"2592513ab4fefe2e57da3122e3a6eda7a3bbe4ac","user":{"login":"yui-knk","id":5356517,"avatar_url":"https://avatars.githubusercontent.com/u/5356517?v=3","gravatar_id":"","url":"https://api.github.com/users/yui-knk","html_url":"https://github.com/yui-knk","followers_url":"https://api.github.com/users/yui-knk/followers","following_url":"https://api.github.com/users/yui-knk/following{/other_user}","gists_url":"https://api.github.com/users/yui-knk/gists{/gist_id}","starred_url":"https://api.github.com/users/yui-knk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yui-knk/subscriptions","organizations_url":"https://api.github.com/users/yui-knk/orgs","repos_url":"https://api.github.com/users/yui-knk/repos","events_url":"https://api.github.com/users/yui-knk/events{/privacy}","received_events_url":"https://api.github.com/users/yui-knk/received_events","type":"User","site_admin":false},"body":"I think `assert_equal` is appropriate.\r\n \r\n`Minitest::Assertions#assert(test, msg = nil)` check if\r\nfirst argument (`test`) is not falsy value, and second argument (`msg`)\r\nis used as a custom error message.\r\n`assert({ active: :archived }, tes.status_archive_transition)` always passes because first arguemtn (`{ active: :archived }`) is truthy.","created_at":"2016-03-23T04:49:39Z","updated_at":"2016-03-23T04:49:39Z","html_url":"https://github.com/amatsuda/stateful_enum/pull/12#discussion_r57109685","pull_request_url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/comments/57109685"},"html":{"href":"https://github.com/amatsuda/stateful_enum/pull/12#discussion_r57109685"},"pull_request":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12","id":63728869,"html_url":"https://github.com/amatsuda/stateful_enum/pull/12","diff_url":"https://github.com/amatsuda/stateful_enum/pull/12.diff","patch_url":"https://github.com/amatsuda/stateful_enum/pull/12.patch","issue_url":"https://api.github.com/repos/amatsuda/stateful_enum/issues/12","number":12,"state":"open","locked":false,"title":"Set prefix and suffix options for Rails 5","user":{"login":"rono23","id":26753,"avatar_url":"https://avatars.githubusercontent.com/u/26753?v=3","gravatar_id":"","url":"https://api.github.com/users/rono23","html_url":"https://github.com/rono23","followers_url":"https://api.github.com/users/rono23/followers","following_url":"https://api.github.com/users/rono23/following{/other_user}","gists_url":"https://api.github.com/users/rono23/gists{/gist_id}","starred_url":"https://api.github.com/users/rono23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rono23/subscriptions","organizations_url":"https://api.github.com/users/rono23/orgs","repos_url":"https://api.github.com/users/rono23/repos","events_url":"https://api.github.com/users/rono23/events{/privacy}","received_events_url":"https://api.github.com/users/rono23/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\n`_prefix` and `_suffix` options are supported from Rails 5.\r\nhttps://github.com/rails/rails/pull/20999\r\n\r\nExample:\r\n\r\n```\r\nclass Conversation < ActiveRecord::Base\r\n  enum status: [:active, :archived], _suffix: true\r\n  enum comments_status: [:active, :inactive], _prefix: :comments\r\nend\r\n```\r\nhttp://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html","created_at":"2016-03-22T14:29:59Z","updated_at":"2016-03-23T04:49:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d4787e5600a1c067373d6e8b5e33cb6f506b27a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12/commits","review_comments_url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12/comments","review_comment_url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amatsuda/stateful_enum/issues/12/comments","statuses_url":"https://api.github.com/repos/amatsuda/stateful_enum/statuses/2592513ab4fefe2e57da3122e3a6eda7a3bbe4ac","head":{"label":"rono23:set-prefix-and-suffix","ref":"set-prefix-and-suffix","sha":"2592513ab4fefe2e57da3122e3a6eda7a3bbe4ac","user":{"login":"rono23","id":26753,"avatar_url":"https://avatars.githubusercontent.com/u/26753?v=3","gravatar_id":"","url":"https://api.github.com/users/rono23","html_url":"https://github.com/rono23","followers_url":"https://api.github.com/users/rono23/followers","following_url":"https://api.github.com/users/rono23/following{/other_user}","gists_url":"https://api.github.com/users/rono23/gists{/gist_id}","starred_url":"https://api.github.com/users/rono23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rono23/subscriptions","organizations_url":"https://api.github.com/users/rono23/orgs","repos_url":"https://api.github.com/users/rono23/repos","events_url":"https://api.github.com/users/rono23/events{/privacy}","received_events_url":"https://api.github.com/users/rono23/received_events","type":"User","site_admin":false},"repo":{"id":54432017,"name":"stateful_enum","full_name":"rono23/stateful_enum","owner":{"login":"rono23","id":26753,"avatar_url":"https://avatars.githubusercontent.com/u/26753?v=3","gravatar_id":"","url":"https://api.github.com/users/rono23","html_url":"https://github.com/rono23","followers_url":"https://api.github.com/users/rono23/followers","following_url":"https://api.github.com/users/rono23/following{/other_user}","gists_url":"https://api.github.com/users/rono23/gists{/gist_id}","starred_url":"https://api.github.com/users/rono23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rono23/subscriptions","organizations_url":"https://api.github.com/users/rono23/orgs","repos_url":"https://api.github.com/users/rono23/repos","events_url":"https://api.github.com/users/rono23/events{/privacy}","received_events_url":"https://api.github.com/users/rono23/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rono23/stateful_enum","description":"A very simple state machine plugin built on top of ActiveRecord::Enum","fork":true,"url":"https://api.github.com/repos/rono23/stateful_enum","forks_url":"https://api.github.com/repos/rono23/stateful_enum/forks","keys_url":"https://api.github.com/repos/rono23/stateful_enum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rono23/stateful_enum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rono23/stateful_enum/teams","hooks_url":"https://api.github.com/repos/rono23/stateful_enum/hooks","issue_events_url":"https://api.github.com/repos/rono23/stateful_enum/issues/events{/number}","events_url":"https://api.github.com/repos/rono23/stateful_enum/events","assignees_url":"https://api.github.com/repos/rono23/stateful_enum/assignees{/user}","branches_url":"https://api.github.com/repos/rono23/stateful_enum/branches{/branch}","tags_url":"https://api.github.com/repos/rono23/stateful_enum/tags","blobs_url":"https://api.github.com/repos/rono23/stateful_enum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rono23/stateful_enum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rono23/stateful_enum/git/refs{/sha}","trees_url":"https://api.github.com/repos/rono23/stateful_enum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rono23/stateful_enum/statuses/{sha}","languages_url":"https://api.github.com/repos/rono23/stateful_enum/languages","stargazers_url":"https://api.github.com/repos/rono23/stateful_enum/stargazers","contributors_url":"https://api.github.com/repos/rono23/stateful_enum/contributors","subscribers_url":"https://api.github.com/repos/rono23/stateful_enum/subscribers","subscription_url":"https://api.github.com/repos/rono23/stateful_enum/subscription","commits_url":"https://api.github.com/repos/rono23/stateful_enum/commits{/sha}","git_commits_url":"https://api.github.com/repos/rono23/stateful_enum/git/commits{/sha}","comments_url":"https://api.github.com/repos/rono23/stateful_enum/comments{/number}","issue_comment_url":"https://api.github.com/repos/rono23/stateful_enum/issues/comments{/number}","contents_url":"https://api.github.com/repos/rono23/stateful_enum/contents/{+path}","compare_url":"https://api.github.com/repos/rono23/stateful_enum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rono23/stateful_enum/merges","archive_url":"https://api.github.com/repos/rono23/stateful_enum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rono23/stateful_enum/downloads","issues_url":"https://api.github.com/repos/rono23/stateful_enum/issues{/number}","pulls_url":"https://api.github.com/repos/rono23/stateful_enum/pulls{/number}","milestones_url":"https://api.github.com/repos/rono23/stateful_enum/milestones{/number}","notifications_url":"https://api.github.com/repos/rono23/stateful_enum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rono23/stateful_enum/labels{/name}","releases_url":"https://api.github.com/repos/rono23/stateful_enum/releases{/id}","deployments_url":"https://api.github.com/repos/rono23/stateful_enum/deployments","created_at":"2016-03-22T00:11:11Z","updated_at":"2016-03-22T00:11:12Z","pushed_at":"2016-03-23T04:42:35Z","git_url":"git://github.com/rono23/stateful_enum.git","ssh_url":"git@github.com:rono23/stateful_enum.git","clone_url":"https://github.com/rono23/stateful_enum.git","svn_url":"https://github.com/rono23/stateful_enum","homepage":"","size":57,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amatsuda:master","ref":"master","sha":"9ca0ec391e6c9ec1d0c2e6bb851cce815712bce2","user":{"login":"amatsuda","id":11493,"avatar_url":"https://avatars.githubusercontent.com/u/11493?v=3","gravatar_id":"","url":"https://api.github.com/users/amatsuda","html_url":"https://github.com/amatsuda","followers_url":"https://api.github.com/users/amatsuda/followers","following_url":"https://api.github.com/users/amatsuda/following{/other_user}","gists_url":"https://api.github.com/users/amatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/amatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatsuda/subscriptions","organizations_url":"https://api.github.com/users/amatsuda/orgs","repos_url":"https://api.github.com/users/amatsuda/repos","events_url":"https://api.github.com/users/amatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/amatsuda/received_events","type":"User","site_admin":false},"repo":{"id":53919902,"name":"stateful_enum","full_name":"amatsuda/stateful_enum","owner":{"login":"amatsuda","id":11493,"avatar_url":"https://avatars.githubusercontent.com/u/11493?v=3","gravatar_id":"","url":"https://api.github.com/users/amatsuda","html_url":"https://github.com/amatsuda","followers_url":"https://api.github.com/users/amatsuda/followers","following_url":"https://api.github.com/users/amatsuda/following{/other_user}","gists_url":"https://api.github.com/users/amatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/amatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amatsuda/subscriptions","organizations_url":"https://api.github.com/users/amatsuda/orgs","repos_url":"https://api.github.com/users/amatsuda/repos","events_url":"https://api.github.com/users/amatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/amatsuda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amatsuda/stateful_enum","description":"A very simple state machine plugin built on top of ActiveRecord::Enum","fork":false,"url":"https://api.github.com/repos/amatsuda/stateful_enum","forks_url":"https://api.github.com/repos/amatsuda/stateful_enum/forks","keys_url":"https://api.github.com/repos/amatsuda/stateful_enum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amatsuda/stateful_enum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amatsuda/stateful_enum/teams","hooks_url":"https://api.github.com/repos/amatsuda/stateful_enum/hooks","issue_events_url":"https://api.github.com/repos/amatsuda/stateful_enum/issues/events{/number}","events_url":"https://api.github.com/repos/amatsuda/stateful_enum/events","assignees_url":"https://api.github.com/repos/amatsuda/stateful_enum/assignees{/user}","branches_url":"https://api.github.com/repos/amatsuda/stateful_enum/branches{/branch}","tags_url":"https://api.github.com/repos/amatsuda/stateful_enum/tags","blobs_url":"https://api.github.com/repos/amatsuda/stateful_enum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amatsuda/stateful_enum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amatsuda/stateful_enum/git/refs{/sha}","trees_url":"https://api.github.com/repos/amatsuda/stateful_enum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amatsuda/stateful_enum/statuses/{sha}","languages_url":"https://api.github.com/repos/amatsuda/stateful_enum/languages","stargazers_url":"https://api.github.com/repos/amatsuda/stateful_enum/stargazers","contributors_url":"https://api.github.com/repos/amatsuda/stateful_enum/contributors","subscribers_url":"https://api.github.com/repos/amatsuda/stateful_enum/subscribers","subscription_url":"https://api.github.com/repos/amatsuda/stateful_enum/subscription","commits_url":"https://api.github.com/repos/amatsuda/stateful_enum/commits{/sha}","git_commits_url":"https://api.github.com/repos/amatsuda/stateful_enum/git/commits{/sha}","comments_url":"https://api.github.com/repos/amatsuda/stateful_enum/comments{/number}","issue_comment_url":"https://api.github.com/repos/amatsuda/stateful_enum/issues/comments{/number}","contents_url":"https://api.github.com/repos/amatsuda/stateful_enum/contents/{+path}","compare_url":"https://api.github.com/repos/amatsuda/stateful_enum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amatsuda/stateful_enum/merges","archive_url":"https://api.github.com/repos/amatsuda/stateful_enum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amatsuda/stateful_enum/downloads","issues_url":"https://api.github.com/repos/amatsuda/stateful_enum/issues{/number}","pulls_url":"https://api.github.com/repos/amatsuda/stateful_enum/pulls{/number}","milestones_url":"https://api.github.com/repos/amatsuda/stateful_enum/milestones{/number}","notifications_url":"https://api.github.com/repos/amatsuda/stateful_enum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amatsuda/stateful_enum/labels{/name}","releases_url":"https://api.github.com/repos/amatsuda/stateful_enum/releases{/id}","deployments_url":"https://api.github.com/repos/amatsuda/stateful_enum/deployments","created_at":"2016-03-15T06:17:46Z","updated_at":"2016-03-23T01:54:35Z","pushed_at":"2016-03-23T04:46:32Z","git_url":"git://github.com/amatsuda/stateful_enum.git","ssh_url":"git@github.com:amatsuda/stateful_enum.git","clone_url":"https://github.com/amatsuda/stateful_enum.git","svn_url":"https://github.com/amatsuda/stateful_enum","homepage":"","size":57,"stargazers_count":180,"watchers_count":180,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12"},"html":{"href":"https://github.com/amatsuda/stateful_enum/pull/12"},"issue":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/issues/12"},"comments":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/amatsuda/stateful_enum/statuses/2592513ab4fefe2e57da3122e3a6eda7a3bbe4ac"}}}}