{"action":"created","comment":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/24350151","id":24350151,"diff_hunk":"@@ -0,0 +1,65 @@\n+module Shoulda\n+  module Matchers\n+    module ActiveModel\n+      # @private\n+      class ValidationMessageFinder\n+        include Helpers\n+\n+        def initialize(instance, attribute, context=nil)\n+          @instance = instance\n+          @attribute = attribute\n+          @context = context\n+        end\n+\n+        def allow_description(allowed_values)\n+          \"allow #{@attribute} to be set to #{allowed_values}\"\n+        end\n+\n+        def expected_message_from(attribute_message)\n+          attribute_message\n+        end\n+\n+        def has_messages?\n+          errors.present?\n+        end\n+\n+        def source_description\n+          'errors'\n+        end\n+\n+        def messages_description\n+          if errors.empty?\n+            ' no errors'\n+          else\n+            \" errors:\\n#{pretty_error_messages(validated_instance)}\"\n+          end\n+        end\n+\n+        def messages\n+          Array(messages_for_attribute)\n+        end\n+\n+        private\n+\n+        def messages_for_attribute\n+          errors[@attribute]\n+        end\n+\n+        def errors\n+          validated_instance.errors\n+        end\n+\n+        def validated_instance\n+          @validated_instance ||= validate_instance\n+        end\n+\n+        def validate_instance\n+          @instance.valid?(*@context)\n+          @instance\n+        end\n+      end\n+\n+    end\n+  end\n+end\n+","path":"lib/shoulda/matchers/active_model/validation_message_finder.rb","position":65,"original_position":65,"commit_id":"535fe05be8686fdafd8b22f2ed5c4192bd565d50","original_commit_id":"535fe05be8686fdafd8b22f2ed5c4192bd565d50","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"1 trailing blank lines detected.","created_at":"2015-02-09T18:12:06Z","updated_at":"2015-02-09T18:12:06Z","html_url":"https://github.com/thoughtbot/shoulda-matchers/pull/657#discussion_r24350151","pull_request_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657","_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/24350151"},"html":{"href":"https://github.com/thoughtbot/shoulda-matchers/pull/657#discussion_r24350151"},"pull_request":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657"}}},"pull_request":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657","id":28943103,"html_url":"https://github.com/thoughtbot/shoulda-matchers/pull/657","diff_url":"https://github.com/thoughtbot/shoulda-matchers/pull/657.diff","patch_url":"https://github.com/thoughtbot/shoulda-matchers/pull/657.patch","issue_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/657","number":657,"state":"open","locked":false,"title":"[wip] Initial 3.0 updates","user":{"login":"mcmire","id":7371,"avatar_url":"https://avatars.githubusercontent.com/u/7371?v=3","gravatar_id":"","url":"https://api.github.com/users/mcmire","html_url":"https://github.com/mcmire","followers_url":"https://api.github.com/users/mcmire/followers","following_url":"https://api.github.com/users/mcmire/following{/other_user}","gists_url":"https://api.github.com/users/mcmire/gists{/gist_id}","starred_url":"https://api.github.com/users/mcmire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcmire/subscriptions","organizations_url":"https://api.github.com/users/mcmire/orgs","repos_url":"https://api.github.com/users/mcmire/repos","events_url":"https://api.github.com/users/mcmire/events{/privacy}","received_events_url":"https://api.github.com/users/mcmire/received_events","type":"User","site_admin":false},"body":"* Remove support for Rails 3.x, Ruby 1.9.2, Ruby 1.9.3\r\n* Change behavior of should_not allow_value (fixes #347, #343, #380, #175)\r\n* Remove automatic integration with test frameworks\r\n* Remove deprecated `ensure_*` matchers\r\n* Remove `set_the_flash` in favor of `set_flash` ","created_at":"2015-02-09T18:11:50Z","updated_at":"2015-02-09T18:12:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"631023d829e7082d90b8b4ffc0dc0724342b2c0d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/{number}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/657/comments","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/535fe05be8686fdafd8b22f2ed5c4192bd565d50","head":{"label":"thoughtbot:ew-three-dot-oh","ref":"ew-three-dot-oh","sha":"535fe05be8686fdafd8b22f2ed5c4192bd565d50","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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":1172597,"name":"shoulda-matchers","full_name":"thoughtbot/shoulda-matchers","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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/shoulda-matchers","description":"Collection of testing matchers extracted from Shoulda","fork":false,"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers","forks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/forks","keys_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/teams","hooks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/events","assignees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/tags","blobs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscription","commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/merges","archive_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/downloads","issues_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/releases{/id}","created_at":"2010-12-15T22:41:52Z","updated_at":"2015-02-09T17:47:30Z","pushed_at":"2015-02-09T18:04:13Z","git_url":"git://github.com/thoughtbot/shoulda-matchers.git","ssh_url":"git@github.com:thoughtbot/shoulda-matchers.git","clone_url":"https://github.com/thoughtbot/shoulda-matchers.git","svn_url":"https://github.com/thoughtbot/shoulda-matchers","homepage":"http://matchers.shoulda.io","size":16880,"stargazers_count":1071,"watchers_count":1071,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":310,"mirror_url":null,"open_issues_count":49,"forks":310,"open_issues":49,"watchers":1071,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"093268eac41ec3fe86d37eb316c2ab15ae3b9a46","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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":1172597,"name":"shoulda-matchers","full_name":"thoughtbot/shoulda-matchers","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","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/shoulda-matchers","description":"Collection of testing matchers extracted from Shoulda","fork":false,"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers","forks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/forks","keys_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/teams","hooks_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/events","assignees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/tags","blobs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/subscription","commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/{number}","contents_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/merges","archive_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/downloads","issues_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/releases{/id}","created_at":"2010-12-15T22:41:52Z","updated_at":"2015-02-09T17:47:30Z","pushed_at":"2015-02-09T18:04:13Z","git_url":"git://github.com/thoughtbot/shoulda-matchers.git","ssh_url":"git@github.com:thoughtbot/shoulda-matchers.git","clone_url":"https://github.com/thoughtbot/shoulda-matchers.git","svn_url":"https://github.com/thoughtbot/shoulda-matchers","homepage":"http://matchers.shoulda.io","size":16880,"stargazers_count":1071,"watchers_count":1071,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":310,"mirror_url":null,"open_issues_count":49,"forks":310,"open_issues":49,"watchers":1071,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657"},"html":{"href":"https://github.com/thoughtbot/shoulda-matchers/pull/657"},"issue":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/657"},"comments":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/657/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/pulls/657/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/shoulda-matchers/statuses/535fe05be8686fdafd8b22f2ed5c4192bd565d50"}}}}