{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/814","repository_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/814/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/814/comments","events_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/814/events","html_url":"https://github.com/thoughtbot/shoulda-matchers/issues/814","id":112784524,"number":814,"title":"undefined method `type' for nil:NilClass when using validate_uniqueness_of(...).scoped_to(AnArray)","user":{"login":"gmmcal","id":1676127,"avatar_url":"https://avatars.githubusercontent.com/u/1676127?v=3","gravatar_id":"","url":"https://api.github.com/users/gmmcal","html_url":"https://github.com/gmmcal","followers_url":"https://api.github.com/users/gmmcal/followers","following_url":"https://api.github.com/users/gmmcal/following{/other_user}","gists_url":"https://api.github.com/users/gmmcal/gists{/gist_id}","starred_url":"https://api.github.com/users/gmmcal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmmcal/subscriptions","organizations_url":"https://api.github.com/users/gmmcal/orgs","repos_url":"https://api.github.com/users/gmmcal/repos","events_url":"https://api.github.com/users/gmmcal/events{/privacy}","received_events_url":"https://api.github.com/users/gmmcal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/9","html_url":"https://github.com/thoughtbot/shoulda-matchers/milestones/3.x","labels_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/milestones/9/labels","id":1126570,"number":9,"title":"3.x","description":"","creator":{"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},"open_issues":22,"closed_issues":2,"state":"open","created_at":"2015-05-22T22:18:18Z","updated_at":"2016-07-12T22:57:45Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2015-10-22T11:36:54Z","updated_at":"2016-10-04T09:14:57Z","closed_at":null,"body":"When using a validation like\r\n\r\n`validates :a_field, uniqueness: { scope: [:an_association, :another_association]`\r\n\r\nand running the test as\r\n\r\n`it { should validate_uniqueness_of(:a_field).scoped_to([:an_association, :another_association]) }`\r\n\r\nproduces an error\r\n\r\n```\r\nFailure/Error: it { should validate_uniqueness_of(:a_field).scoped_to([:an_association, :another_association]) }\r\nNoMethodError:\r\n  undefined method `type' for nil:NilClass\r\n\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:473:in `dummy_scalar_value_for'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:468:in `dummy_value_for'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:441:in `block in validate_after_scope_change?'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:436:in `each'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:436:in `all?'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:436:in `validate_after_scope_change?'\r\n  # shoulda-matchers-3.0.0/lib/shoulda/matchers/active_record/validate_uniqueness_of_matcher.rb:266:in `matches?'\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/comments/251336538","html_url":"https://github.com/thoughtbot/shoulda-matchers/issues/814#issuecomment-251336538","issue_url":"https://api.github.com/repos/thoughtbot/shoulda-matchers/issues/814","id":251336538,"user":{"login":"electricdrop","id":12648348,"avatar_url":"https://avatars.githubusercontent.com/u/12648348?v=3","gravatar_id":"","url":"https://api.github.com/users/electricdrop","html_url":"https://github.com/electricdrop","followers_url":"https://api.github.com/users/electricdrop/followers","following_url":"https://api.github.com/users/electricdrop/following{/other_user}","gists_url":"https://api.github.com/users/electricdrop/gists{/gist_id}","starred_url":"https://api.github.com/users/electricdrop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electricdrop/subscriptions","organizations_url":"https://api.github.com/users/electricdrop/orgs","repos_url":"https://api.github.com/users/electricdrop/repos","events_url":"https://api.github.com/users/electricdrop/events{/privacy}","received_events_url":"https://api.github.com/users/electricdrop/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T09:14:57Z","updated_at":"2016-10-04T09:14:57Z","body":"+1"}}
{"actor":{"display_login":"electricdrop"}}