{"action":"created","issue":{"url":"https://api.github.com/repos/dpla/primary-source-sets/issues/24","labels_url":"https://api.github.com/repos/dpla/primary-source-sets/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/dpla/primary-source-sets/issues/24/comments","events_url":"https://api.github.com/repos/dpla/primary-source-sets/issues/24/events","html_url":"https://github.com/dpla/primary-source-sets/pull/24","id":108669818,"number":24,"title":"Feature/media scaffolding","user":{"login":"AudreyAltman","id":3615206,"avatar_url":"https://avatars.githubusercontent.com/u/3615206?v=3","gravatar_id":"","url":"https://api.github.com/users/AudreyAltman","html_url":"https://github.com/AudreyAltman","followers_url":"https://api.github.com/users/AudreyAltman/followers","following_url":"https://api.github.com/users/AudreyAltman/following{/other_user}","gists_url":"https://api.github.com/users/AudreyAltman/gists{/gist_id}","starred_url":"https://api.github.com/users/AudreyAltman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudreyAltman/subscriptions","organizations_url":"https://api.github.com/users/AudreyAltman/orgs","repos_url":"https://api.github.com/users/AudreyAltman/repos","events_url":"https://api.github.com/users/AudreyAltman/events{/privacy}","received_events_url":"https://api.github.com/users/AudreyAltman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-28T14:30:49Z","updated_at":"2015-09-30T02:43:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dpla/primary-source-sets/pulls/24","html_url":"https://github.com/dpla/primary-source-sets/pull/24","diff_url":"https://github.com/dpla/primary-source-sets/pull/24.diff","patch_url":"https://github.com/dpla/primary-source-sets/pull/24.patch"},"body":"This introduces the basic database tables, models, views, and controllers for media objects, including their relationships to source sets and sources.  It addresses [#8025](https://issues.dp.la/issues/8025) and follows the [ER Diagram](https://digitalpubliclibraryofamerica.atlassian.net/wiki/display/TECH/Relational+Database+Model).  This does NOT allow admins to upload actual media files, just their related metadata.\r\n\r\nMedia objects (images, video, audio, and documents) form a conceptual group of \"assets\".  Assets belong to \"attachable\" objects (sources or source sets).  \"Assets\" and \"attachables\" don't lend themselves to explicit representation in the relational database, nor did it seem helpful to make \"asset\" and \"attachable\" classes or mixins in the application.  Instead, \"assets\" and \"attachables\" are defined through relationships and accessors in the models.  These conceptual object types are helpful because they allow you to refer generically to, say, a source's `asset` without needed to know whether that `assets` is an image, video, etc.  There is a `shared_examples` [spec for \"assets\"](https://github.com/dpla/primary-source-sets/blob/980d72f8664f9ee84645b7a07a0c1ce39a82438c/spec/support/shared_examples/media_asset.rb) that describes the expected behavior of an \"asset\".\r\n\r\nThis refactors some controller specs, introducing some `shared_examples` to DRY them out.\r\n\r\nTo run tests locally:  remember to do `rake db:test:prepare`.\r\n\r\nTo run the server locally:  remember to clean up your database to get rid of any old data that conforms to previous database schema.  I find it easiest to do `bundle exec rake db:drop db:create db:migrate`."},"comment":{"url":"https://api.github.com/repos/dpla/primary-source-sets/issues/comments/144263885","html_url":"https://github.com/dpla/primary-source-sets/pull/24#issuecomment-144263885","issue_url":"https://api.github.com/repos/dpla/primary-source-sets/issues/24","id":144263885,"user":{"login":"AudreyAltman","id":3615206,"avatar_url":"https://avatars.githubusercontent.com/u/3615206?v=3","gravatar_id":"","url":"https://api.github.com/users/AudreyAltman","html_url":"https://github.com/AudreyAltman","followers_url":"https://api.github.com/users/AudreyAltman/followers","following_url":"https://api.github.com/users/AudreyAltman/following{/other_user}","gists_url":"https://api.github.com/users/AudreyAltman/gists{/gist_id}","starred_url":"https://api.github.com/users/AudreyAltman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudreyAltman/subscriptions","organizations_url":"https://api.github.com/users/AudreyAltman/orgs","repos_url":"https://api.github.com/users/AudreyAltman/repos","events_url":"https://api.github.com/users/AudreyAltman/events{/privacy}","received_events_url":"https://api.github.com/users/AudreyAltman/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T02:43:37Z","updated_at":"2015-09-30T02:43:37Z","body":":squash:ed and rebased to develop"}}