{"action":"opened","number":326,"pull_request":{"url":"https://api.github.com/repos/solnic/virtus/pulls/326","id":39214135,"html_url":"https://github.com/solnic/virtus/pull/326","diff_url":"https://github.com/solnic/virtus/pull/326.diff","patch_url":"https://github.com/solnic/virtus/pull/326.patch","issue_url":"https://api.github.com/repos/solnic/virtus/issues/326","number":326,"state":"open","locked":false,"title":"325 mass assignment bug fix","user":{"login":"novikserg","id":3332891,"avatar_url":"https://avatars.githubusercontent.com/u/3332891?v=3","gravatar_id":"","url":"https://api.github.com/users/novikserg","html_url":"https://github.com/novikserg","followers_url":"https://api.github.com/users/novikserg/followers","following_url":"https://api.github.com/users/novikserg/following{/other_user}","gists_url":"https://api.github.com/users/novikserg/gists{/gist_id}","starred_url":"https://api.github.com/users/novikserg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novikserg/subscriptions","organizations_url":"https://api.github.com/users/novikserg/orgs","repos_url":"https://api.github.com/users/novikserg/repos","events_url":"https://api.github.com/users/novikserg/events{/privacy}","received_events_url":"https://api.github.com/users/novikserg/received_events","type":"User","site_admin":false},"body":"So I decided to fix the bug referenced in #325. \r\nThis PR reverts commit a385ca2e6b724ec400c05a4bc7e55bfb9976c1c9 and adds specs for situation when user wants to use \"attributes\" as attribute name.\r\n\r\nI tried to first keep the initial intention of a385ca2e6b724ec400c05a4bc7e55bfb9976c1c9 and make AllowedWriterMethods module be included only when mass-assignment is turned on, however I found it being tied into object initialization pretty tightly:\r\nhttps://github.com/solnic/virtus/blob/d494b95e4181cda44c44d58566cee2185f9a6d9e/lib/virtus/attribute_set.rb#L169\r\nhttps://github.com/solnic/virtus/blob/d494b95e4181cda44c44d58566cee2185f9a6d9e/lib/virtus/instance_methods.rb#L16\r\nso it wouldn't be that easy of a change. So my suggestion is to revert that old commit (since it's intended goal is not reached anyway, unfortunately) to fix a bug and keep it as a reference for future when this refactoring can be actually done.\r\n\r\n@solnic what do you think?","created_at":"2015-07-04T23:26:04Z","updated_at":"2015-07-04T23:26:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/solnic/virtus/pulls/326/commits","review_comments_url":"https://api.github.com/repos/solnic/virtus/pulls/326/comments","review_comment_url":"https://api.github.com/repos/solnic/virtus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solnic/virtus/issues/326/comments","statuses_url":"https://api.github.com/repos/solnic/virtus/statuses/00b9d854bbd05863d52f194d4a2f4d0578f29faa","head":{"label":"novikserg:325_mass_assignment_bug_fix","ref":"325_mass_assignment_bug_fix","sha":"00b9d854bbd05863d52f194d4a2f4d0578f29faa","user":{"login":"novikserg","id":3332891,"avatar_url":"https://avatars.githubusercontent.com/u/3332891?v=3","gravatar_id":"","url":"https://api.github.com/users/novikserg","html_url":"https://github.com/novikserg","followers_url":"https://api.github.com/users/novikserg/followers","following_url":"https://api.github.com/users/novikserg/following{/other_user}","gists_url":"https://api.github.com/users/novikserg/gists{/gist_id}","starred_url":"https://api.github.com/users/novikserg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novikserg/subscriptions","organizations_url":"https://api.github.com/users/novikserg/orgs","repos_url":"https://api.github.com/users/novikserg/repos","events_url":"https://api.github.com/users/novikserg/events{/privacy}","received_events_url":"https://api.github.com/users/novikserg/received_events","type":"User","site_admin":false},"repo":{"id":38513894,"name":"virtus","full_name":"novikserg/virtus","owner":{"login":"novikserg","id":3332891,"avatar_url":"https://avatars.githubusercontent.com/u/3332891?v=3","gravatar_id":"","url":"https://api.github.com/users/novikserg","html_url":"https://github.com/novikserg","followers_url":"https://api.github.com/users/novikserg/followers","following_url":"https://api.github.com/users/novikserg/following{/other_user}","gists_url":"https://api.github.com/users/novikserg/gists{/gist_id}","starred_url":"https://api.github.com/users/novikserg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novikserg/subscriptions","organizations_url":"https://api.github.com/users/novikserg/orgs","repos_url":"https://api.github.com/users/novikserg/repos","events_url":"https://api.github.com/users/novikserg/events{/privacy}","received_events_url":"https://api.github.com/users/novikserg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/novikserg/virtus","description":"Attributes on Steroids for Plain Old Ruby Objects","fork":true,"url":"https://api.github.com/repos/novikserg/virtus","forks_url":"https://api.github.com/repos/novikserg/virtus/forks","keys_url":"https://api.github.com/repos/novikserg/virtus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novikserg/virtus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novikserg/virtus/teams","hooks_url":"https://api.github.com/repos/novikserg/virtus/hooks","issue_events_url":"https://api.github.com/repos/novikserg/virtus/issues/events{/number}","events_url":"https://api.github.com/repos/novikserg/virtus/events","assignees_url":"https://api.github.com/repos/novikserg/virtus/assignees{/user}","branches_url":"https://api.github.com/repos/novikserg/virtus/branches{/branch}","tags_url":"https://api.github.com/repos/novikserg/virtus/tags","blobs_url":"https://api.github.com/repos/novikserg/virtus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novikserg/virtus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novikserg/virtus/git/refs{/sha}","trees_url":"https://api.github.com/repos/novikserg/virtus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novikserg/virtus/statuses/{sha}","languages_url":"https://api.github.com/repos/novikserg/virtus/languages","stargazers_url":"https://api.github.com/repos/novikserg/virtus/stargazers","contributors_url":"https://api.github.com/repos/novikserg/virtus/contributors","subscribers_url":"https://api.github.com/repos/novikserg/virtus/subscribers","subscription_url":"https://api.github.com/repos/novikserg/virtus/subscription","commits_url":"https://api.github.com/repos/novikserg/virtus/commits{/sha}","git_commits_url":"https://api.github.com/repos/novikserg/virtus/git/commits{/sha}","comments_url":"https://api.github.com/repos/novikserg/virtus/comments{/number}","issue_comment_url":"https://api.github.com/repos/novikserg/virtus/issues/comments{/number}","contents_url":"https://api.github.com/repos/novikserg/virtus/contents/{+path}","compare_url":"https://api.github.com/repos/novikserg/virtus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novikserg/virtus/merges","archive_url":"https://api.github.com/repos/novikserg/virtus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novikserg/virtus/downloads","issues_url":"https://api.github.com/repos/novikserg/virtus/issues{/number}","pulls_url":"https://api.github.com/repos/novikserg/virtus/pulls{/number}","milestones_url":"https://api.github.com/repos/novikserg/virtus/milestones{/number}","notifications_url":"https://api.github.com/repos/novikserg/virtus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novikserg/virtus/labels{/name}","releases_url":"https://api.github.com/repos/novikserg/virtus/releases{/id}","created_at":"2015-07-03T23:10:06Z","updated_at":"2015-07-03T23:10:08Z","pushed_at":"2015-07-04T23:02:23Z","git_url":"git://github.com/novikserg/virtus.git","ssh_url":"git@github.com:novikserg/virtus.git","clone_url":"https://github.com/novikserg/virtus.git","svn_url":"https://github.com/novikserg/virtus","homepage":"","size":2148,"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":"solnic:master","ref":"master","sha":"d494b95e4181cda44c44d58566cee2185f9a6d9e","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"repo":{"id":1559931,"name":"virtus","full_name":"solnic/virtus","owner":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/solnic/virtus","description":"Attributes on Steroids for Plain Old Ruby Objects","fork":false,"url":"https://api.github.com/repos/solnic/virtus","forks_url":"https://api.github.com/repos/solnic/virtus/forks","keys_url":"https://api.github.com/repos/solnic/virtus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solnic/virtus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solnic/virtus/teams","hooks_url":"https://api.github.com/repos/solnic/virtus/hooks","issue_events_url":"https://api.github.com/repos/solnic/virtus/issues/events{/number}","events_url":"https://api.github.com/repos/solnic/virtus/events","assignees_url":"https://api.github.com/repos/solnic/virtus/assignees{/user}","branches_url":"https://api.github.com/repos/solnic/virtus/branches{/branch}","tags_url":"https://api.github.com/repos/solnic/virtus/tags","blobs_url":"https://api.github.com/repos/solnic/virtus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solnic/virtus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solnic/virtus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solnic/virtus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solnic/virtus/statuses/{sha}","languages_url":"https://api.github.com/repos/solnic/virtus/languages","stargazers_url":"https://api.github.com/repos/solnic/virtus/stargazers","contributors_url":"https://api.github.com/repos/solnic/virtus/contributors","subscribers_url":"https://api.github.com/repos/solnic/virtus/subscribers","subscription_url":"https://api.github.com/repos/solnic/virtus/subscription","commits_url":"https://api.github.com/repos/solnic/virtus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solnic/virtus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solnic/virtus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solnic/virtus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solnic/virtus/contents/{+path}","compare_url":"https://api.github.com/repos/solnic/virtus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solnic/virtus/merges","archive_url":"https://api.github.com/repos/solnic/virtus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solnic/virtus/downloads","issues_url":"https://api.github.com/repos/solnic/virtus/issues{/number}","pulls_url":"https://api.github.com/repos/solnic/virtus/pulls{/number}","milestones_url":"https://api.github.com/repos/solnic/virtus/milestones{/number}","notifications_url":"https://api.github.com/repos/solnic/virtus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solnic/virtus/labels{/name}","releases_url":"https://api.github.com/repos/solnic/virtus/releases{/id}","created_at":"2011-04-02T16:23:50Z","updated_at":"2015-07-03T19:56:23Z","pushed_at":"2015-04-16T13:31:57Z","git_url":"git://github.com/solnic/virtus.git","ssh_url":"git@github.com:solnic/virtus.git","clone_url":"https://github.com/solnic/virtus.git","svn_url":"https://github.com/solnic/virtus","homepage":"","size":3494,"stargazers_count":2542,"watchers_count":2542,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":168,"mirror_url":null,"open_issues_count":34,"forks":168,"open_issues":34,"watchers":2542,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solnic/virtus/pulls/326"},"html":{"href":"https://github.com/solnic/virtus/pull/326"},"issue":{"href":"https://api.github.com/repos/solnic/virtus/issues/326"},"comments":{"href":"https://api.github.com/repos/solnic/virtus/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/solnic/virtus/pulls/326/comments"},"review_comment":{"href":"https://api.github.com/repos/solnic/virtus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solnic/virtus/pulls/326/commits"},"statuses":{"href":"https://api.github.com/repos/solnic/virtus/statuses/00b9d854bbd05863d52f194d4a2f4d0578f29faa"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":42,"deletions":29,"changed_files":6}}