{"action":"opened","issue":{"url":"https://api.github.com/repos/smashingboxes/cardboard/issues/125","labels_url":"https://api.github.com/repos/smashingboxes/cardboard/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/smashingboxes/cardboard/issues/125/comments","events_url":"https://api.github.com/repos/smashingboxes/cardboard/issues/125/events","html_url":"https://github.com/smashingboxes/cardboard/issues/125","id":55302095,"number":125,"title":"Images/Files defaults","user":{"login":"leonelgalan","id":727774,"avatar_url":"https://avatars.githubusercontent.com/u/727774?v=3","gravatar_id":"","url":"https://api.github.com/users/leonelgalan","html_url":"https://github.com/leonelgalan","followers_url":"https://api.github.com/users/leonelgalan/followers","following_url":"https://api.github.com/users/leonelgalan/following{/other_user}","gists_url":"https://api.github.com/users/leonelgalan/gists{/gist_id}","starred_url":"https://api.github.com/users/leonelgalan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonelgalan/subscriptions","organizations_url":"https://api.github.com/users/leonelgalan/orgs","repos_url":"https://api.github.com/users/leonelgalan/repos","events_url":"https://api.github.com/users/leonelgalan/events{/privacy}","received_events_url":"https://api.github.com/users/leonelgalan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/smashingboxes/cardboard/labels/conversation","name":"conversation","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-23T16:32:51Z","updated_at":"2015-01-23T16:32:51Z","closed_at":null,"body":"See https://github.com/smashingboxes/cardboard/commit/eb14892856ae495f099c145158053384b776284c\r\n\r\nIn this commit it was decided that defaults for files/images where going to live in _app/assest/(files|images)defaults/_. The \"benefit\" of this is that the file isn't duplicated when running the seeds, but the downside is increased complexity in:\r\n\r\n* https://github.com/smashingboxes/cardboard/blob/2735badff3cb2c9ccf7ef4d4e185f0705b28d142/app/models/cardboard/field.rb#L51\r\n* https://github.com/smashingboxes/cardboard/blob/2735badff3cb2c9ccf7ef4d4e185f0705b28d142/app/models/cardboard/field/file.rb#L9\r\n* https://github.com/smashingboxes/cardboard/blob/2735badff3cb2c9ccf7ef4d4e185f0705b28d142/app/models/cardboard/field/image.rb#L12\r\n\r\nI think having some duplicate files is better than how increasing the complexity of this code. If storing images on S3, for example: we would have some images on _app/assets/.._ and some on S3.\r\n\r\nI found this while rewriting the file specs and noting that `value=` and `update_attributes` weren't working as expected. This might be related to overwriting value on the file field.\r\n\r\n```ruby\r\n# Doesn't work:\r\n@field.value = support_file('blank.pdf')\r\n@field.update_attributes value: support_file('blank.pdf')\r\n# Works:\r\n@field.update_attribute :value, support_file('blank.pdf')\r\n```\r\n"}}