{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/39461946","id":39461946,"diff_hunk":"@@ -4,12 +4,18 @@ class UserAddress < Spree::Base\n     belongs_to :address, class_name: \"Spree::Address\"\n \n     validates_uniqueness_of :address_id, scope: :user_id\n-    validates_uniqueness_of :user_id, conditions: -> { where(default: true) }, message: :default_address_exists, if: :default?\n+    validates_uniqueness_of :user_id, conditions: -> { where(default: true, archived: false) }, message: :default_address_exists, if: :default?\n \n     scope :with_address_values, ->(address_attributes) do\n       joins(:address).merge(\n         Spree::Address.with_values(address_attributes)\n       )\n     end\n+\n+    scope :all_historical, ->() do","path":"core/app/models/spree/user_address.rb","position":13,"original_position":13,"commit_id":"54b324aa02c8c0ae88415df1015b2647bdb648b7","original_commit_id":"54b324aa02c8c0ae88415df1015b2647bdb648b7","user":{"login":"grzlus","id":1580215,"avatar_url":"https://avatars.githubusercontent.com/u/1580215?v=3","gravatar_id":"","url":"https://api.github.com/users/grzlus","html_url":"https://github.com/grzlus","followers_url":"https://api.github.com/users/grzlus/followers","following_url":"https://api.github.com/users/grzlus/following{/other_user}","gists_url":"https://api.github.com/users/grzlus/gists{/gist_id}","starred_url":"https://api.github.com/users/grzlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grzlus/subscriptions","organizations_url":"https://api.github.com/users/grzlus/orgs","repos_url":"https://api.github.com/users/grzlus/repos","events_url":"https://api.github.com/users/grzlus/events{/privacy}","received_events_url":"https://api.github.com/users/grzlus/received_events","type":"User","site_admin":false},"body":"Don't left empty parentes in lambdas.\r\nThis scope is so small, that should be in one line.","created_at":"2015-09-15T00:00:39Z","updated_at":"2015-09-15T00:00:39Z","html_url":"https://github.com/solidusio/solidus/pull/366#discussion_r39461946","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/366","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/39461946"},"html":{"href":"https://github.com/solidusio/solidus/pull/366#discussion_r39461946"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/366"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/366","id":44986166,"html_url":"https://github.com/solidusio/solidus/pull/366","diff_url":"https://github.com/solidusio/solidus/pull/366.diff","patch_url":"https://github.com/solidusio/solidus/pull/366.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/366","number":366,"state":"open","locked":false,"title":"new AddressBookController","user":{"login":"gvaughn","id":10173,"avatar_url":"https://avatars.githubusercontent.com/u/10173?v=3","gravatar_id":"","url":"https://api.github.com/users/gvaughn","html_url":"https://github.com/gvaughn","followers_url":"https://api.github.com/users/gvaughn/followers","following_url":"https://api.github.com/users/gvaughn/following{/other_user}","gists_url":"https://api.github.com/users/gvaughn/gists{/gist_id}","starred_url":"https://api.github.com/users/gvaughn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvaughn/subscriptions","organizations_url":"https://api.github.com/users/gvaughn/orgs","repos_url":"https://api.github.com/users/gvaughn/repos","events_url":"https://api.github.com/users/gvaughn/events{/privacy}","received_events_url":"https://api.github.com/users/gvaughn/received_events","type":"User","site_admin":false},"body":"This is the followup to my prior address book work. It:\r\n\r\nprovides endpoints suitable for a custom address book management UI\r\nadds a Spree:Config preference: automatic_default_address\r\ntest coverage","created_at":"2015-09-14T21:56:45Z","updated_at":"2015-09-15T00:00:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b23f160bcda81bc79f116b0868c3c6331e52467e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/366/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/366/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/366/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/54b324aa02c8c0ae88415df1015b2647bdb648b7","head":{"label":"bonobos:address_book","ref":"address_book","sha":"54b324aa02c8c0ae88415df1015b2647bdb648b7","user":{"login":"bonobos","id":78914,"avatar_url":"https://avatars.githubusercontent.com/u/78914?v=3","gravatar_id":"","url":"https://api.github.com/users/bonobos","html_url":"https://github.com/bonobos","followers_url":"https://api.github.com/users/bonobos/followers","following_url":"https://api.github.com/users/bonobos/following{/other_user}","gists_url":"https://api.github.com/users/bonobos/gists{/gist_id}","starred_url":"https://api.github.com/users/bonobos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bonobos/subscriptions","organizations_url":"https://api.github.com/users/bonobos/orgs","repos_url":"https://api.github.com/users/bonobos/repos","events_url":"https://api.github.com/users/bonobos/events{/privacy}","received_events_url":"https://api.github.com/users/bonobos/received_events","type":"Organization","site_admin":false},"repo":{"id":37876553,"name":"solidus","full_name":"bonobos/solidus","owner":{"login":"bonobos","id":78914,"avatar_url":"https://avatars.githubusercontent.com/u/78914?v=3","gravatar_id":"","url":"https://api.github.com/users/bonobos","html_url":"https://github.com/bonobos","followers_url":"https://api.github.com/users/bonobos/followers","following_url":"https://api.github.com/users/bonobos/following{/other_user}","gists_url":"https://api.github.com/users/bonobos/gists{/gist_id}","starred_url":"https://api.github.com/users/bonobos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bonobos/subscriptions","organizations_url":"https://api.github.com/users/bonobos/orgs","repos_url":"https://api.github.com/users/bonobos/repos","events_url":"https://api.github.com/users/bonobos/events{/privacy}","received_events_url":"https://api.github.com/users/bonobos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bonobos/solidus","description":"Solidus e-commerce system","fork":true,"url":"https://api.github.com/repos/bonobos/solidus","forks_url":"https://api.github.com/repos/bonobos/solidus/forks","keys_url":"https://api.github.com/repos/bonobos/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bonobos/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bonobos/solidus/teams","hooks_url":"https://api.github.com/repos/bonobos/solidus/hooks","issue_events_url":"https://api.github.com/repos/bonobos/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/bonobos/solidus/events","assignees_url":"https://api.github.com/repos/bonobos/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/bonobos/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/bonobos/solidus/tags","blobs_url":"https://api.github.com/repos/bonobos/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bonobos/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bonobos/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/bonobos/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bonobos/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/bonobos/solidus/languages","stargazers_url":"https://api.github.com/repos/bonobos/solidus/stargazers","contributors_url":"https://api.github.com/repos/bonobos/solidus/contributors","subscribers_url":"https://api.github.com/repos/bonobos/solidus/subscribers","subscription_url":"https://api.github.com/repos/bonobos/solidus/subscription","commits_url":"https://api.github.com/repos/bonobos/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/bonobos/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/bonobos/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/bonobos/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/bonobos/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/bonobos/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bonobos/solidus/merges","archive_url":"https://api.github.com/repos/bonobos/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bonobos/solidus/downloads","issues_url":"https://api.github.com/repos/bonobos/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/bonobos/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/bonobos/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/bonobos/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bonobos/solidus/labels{/name}","releases_url":"https://api.github.com/repos/bonobos/solidus/releases{/id}","created_at":"2015-06-22T19:37:20Z","updated_at":"2015-06-22T19:37:24Z","pushed_at":"2015-09-14T21:51:42Z","git_url":"git://github.com/bonobos/solidus.git","ssh_url":"git@github.com:bonobos/solidus.git","clone_url":"https://github.com/bonobos/solidus.git","svn_url":"https://github.com/bonobos/solidus","homepage":"","size":63773,"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":"solidusio:master","ref":"master","sha":"dc29addd89402ebb137005ce4927a02fb2b2be2f","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","created_at":"2015-02-18T20:41:58Z","updated_at":"2015-09-12T23:55:27Z","pushed_at":"2015-09-14T21:56:46Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"http://solidus.io/","size":66966,"stargazers_count":42,"watchers_count":42,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":41,"forks":26,"open_issues":41,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/366"},"html":{"href":"https://github.com/solidusio/solidus/pull/366"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/366"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/366/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/366/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/366/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/54b324aa02c8c0ae88415df1015b2647bdb648b7"}}}}