{"action":"created","issue":{"url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/46","repository_url":"https://api.github.com/repos/hmc-room-draw/room-draw","labels_url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/46/comments","events_url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/46/events","html_url":"https://github.com/hmc-room-draw/room-draw/pull/46","id":265391040,"number":46,"title":"Add Pulls","user":{"login":"sxmichaels","id":13933679,"avatar_url":"https://avatars1.githubusercontent.com/u/13933679?v=4","gravatar_id":"","url":"https://api.github.com/users/sxmichaels","html_url":"https://github.com/sxmichaels","followers_url":"https://api.github.com/users/sxmichaels/followers","following_url":"https://api.github.com/users/sxmichaels/following{/other_user}","gists_url":"https://api.github.com/users/sxmichaels/gists{/gist_id}","starred_url":"https://api.github.com/users/sxmichaels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sxmichaels/subscriptions","organizations_url":"https://api.github.com/users/sxmichaels/orgs","repos_url":"https://api.github.com/users/sxmichaels/repos","events_url":"https://api.github.com/users/sxmichaels/events{/privacy}","received_events_url":"https://api.github.com/users/sxmichaels/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-13T19:11:07Z","updated_at":"2017-10-17T07:29:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/hmc-room-draw/room-draw/pulls/46","html_url":"https://github.com/hmc-room-draw/room-draw/pull/46","diff_url":"https://github.com/hmc-room-draw/room-draw/pull/46.diff","patch_url":"https://github.com/hmc-room-draw/room-draw/pull/46.patch"},"body":"This PR makes the following additions.\r\n* `RoomAssignment` keeps track of which students are in which rooms. Its `assignment_type` enum filed can be `preplaced`, `freshman`, or `pulled`.\r\n* `Pull` objects, which hold a `message` and the ID of the student making the pull (i.e. the student whose number is used). They have many RoomAssignments.\r\n* Students now have a `class_rank` enum: `freshman, sophomore, junior, senior`\r\n* Students now have a `class_rank` enum: `freshman, sophomore, junior, senior`\r\n* Adds the [rails-erd](https://github.com/voormedia/rails-erd) gem. You can now create an entity-relationship diagram of the whole project (see below) via `bundle exec erd`.\r\n\r\nThe new relationships are as follows.\r\n```\r\nclass Pull < ApplicationRecord\r\n  has_many :room_assignments\r\n  has_many :students, through: :room_assignments\r\n  belongs_to :student\r\nend\r\n\r\nclass RoomAssignment < ApplicationRecord\r\n  belongs_to :student\r\n  belongs_to :pull\r\n  belongs_to :room\r\nend\r\n\r\nclass Room < ApplicationRecord\r\n  belongs_to :dorm\r\n  belongs_to :suite\r\n  has_many :room_assignment\r\nend\r\n\r\nclass Student < ApplicationRecord\r\n  belongs_to :user\r\n  has_one :room_assignment\r\n  has_one :pull, through: :room_assignment\r\n  has_one :pull\r\nend\r\n```\r\n\r\nThe entity-relationship diagram for the above additions is below. Note that the indirect relationships (anything with `through:`) seem not to be displayed correctly — for instance, that a Pull has many Students is only an indirect relationship whereas it is displaying as a direct on here. However, I have verified that the indirect relationships do indeed exist via `rails console`.\r\n\r\n![erd](https://user-images.githubusercontent.com/13933679/31562349-e0984188-b00f-11e7-96f0-8ec2cb53400e.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/comments/337142878","html_url":"https://github.com/hmc-room-draw/room-draw/pull/46#issuecomment-337142878","issue_url":"https://api.github.com/repos/hmc-room-draw/room-draw/issues/46","id":337142878,"user":{"login":"AliengirlLiv","id":12390123,"avatar_url":"https://avatars1.githubusercontent.com/u/12390123?v=4","gravatar_id":"","url":"https://api.github.com/users/AliengirlLiv","html_url":"https://github.com/AliengirlLiv","followers_url":"https://api.github.com/users/AliengirlLiv/followers","following_url":"https://api.github.com/users/AliengirlLiv/following{/other_user}","gists_url":"https://api.github.com/users/AliengirlLiv/gists{/gist_id}","starred_url":"https://api.github.com/users/AliengirlLiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliengirlLiv/subscriptions","organizations_url":"https://api.github.com/users/AliengirlLiv/orgs","repos_url":"https://api.github.com/users/AliengirlLiv/repos","events_url":"https://api.github.com/users/AliengirlLiv/events{/privacy}","received_events_url":"https://api.github.com/users/AliengirlLiv/received_events","type":"User","site_admin":false},"created_at":"2017-10-17T07:29:03Z","updated_at":"2017-10-17T07:29:03Z","author_association":"NONE","body":"Could we add an optional \"description\" string to RoomAssignment? This would let admin team allow admins to leave a description of why a room is unpullable (e.g. \"Closed by F&M because of asbestos.\")\r\n\r\nOn a related note - could we have an \"offline\" option in the assignment_type enum to handle rooms which are closed for refurbishment?  And maybe also a miscellaneous \"other\" option for cases which don't fit neatly into the other categories."}}
{"actor":{"display_login":"AliengirlLiv"}}