{"action":"created","issue":{"url":"https://api.github.com/repos/loomio/loomio/issues/2174","labels_url":"https://api.github.com/repos/loomio/loomio/issues/2174/labels{/name}","comments_url":"https://api.github.com/repos/loomio/loomio/issues/2174/comments","events_url":"https://api.github.com/repos/loomio/loomio/issues/2174/events","html_url":"https://github.com/loomio/loomio/issues/2174","id":78401586,"number":2174,"title":"[Refactor]: Loomio attachments","user":{"login":"gdpelican","id":750477,"avatar_url":"https://avatars.githubusercontent.com/u/750477?v=3","gravatar_id":"","url":"https://api.github.com/users/gdpelican","html_url":"https://github.com/gdpelican","followers_url":"https://api.github.com/users/gdpelican/followers","following_url":"https://api.github.com/users/gdpelican/following{/other_user}","gists_url":"https://api.github.com/users/gdpelican/gists{/gist_id}","starred_url":"https://api.github.com/users/gdpelican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdpelican/subscriptions","organizations_url":"https://api.github.com/users/gdpelican/orgs","repos_url":"https://api.github.com/users/gdpelican/repos","events_url":"https://api.github.com/users/gdpelican/events{/privacy}","received_events_url":"https://api.github.com/users/gdpelican/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/loomio/loomio/labels/Feature","name":"Feature","color":"bfe5bf"},{"url":"https://api.github.com/repos/loomio/loomio/labels/Please%20help","name":"Please help","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-20T06:57:17Z","updated_at":"2015-11-18T08:53:09Z","closed_at":"2015-11-18T08:53:09Z","body":"Our current attachment system is a little inflexible, and married to S3, which is no good for a system that wants to be distributable.\r\n\r\nHere's my current thinking on fixing that:\r\n\r\n- :boom: the UploadHelper class; it's married to S3 and is a needlessly complex solution I think.\r\n- add `has_attached_file :upload` to the Attachment class\r\n- Figure out what fiddling needs to be done from there to get attachments to upload correctly through paperclip (instead of S3 directly)... I think it may just be a bit of parameter acro.\r\n- (maybe?) Delegate the methods on avatar's upload so we don't have to worry about changing them everywhere\r\n```\r\nclass Attachment\r\n  has_attached_file :upload\r\n  delegate :url, to: :upload, prefix: false\r\nend\r\n```\r\n- Move hardcoded paperclip defaults out of application.rb and into development.rb / production.rb\r\n  - For development, default to the local filesystem; no one wants to deal with buckets while they're devving.\r\n  - For production, switch on an ENV variable to pick between config hashes for S3, local filesystem etc.\r\n\r\nI'd be super keen to hear some feedback, or if there was anyone interested in hacking on this as a medium-sized project."},"comment":{"url":"https://api.github.com/repos/loomio/loomio/issues/comments/157647539","html_url":"https://github.com/loomio/loomio/issues/2174#issuecomment-157647539","issue_url":"https://api.github.com/repos/loomio/loomio/issues/2174","id":157647539,"user":{"login":"gdpelican","id":750477,"avatar_url":"https://avatars.githubusercontent.com/u/750477?v=3","gravatar_id":"","url":"https://api.github.com/users/gdpelican","html_url":"https://github.com/gdpelican","followers_url":"https://api.github.com/users/gdpelican/followers","following_url":"https://api.github.com/users/gdpelican/following{/other_user}","gists_url":"https://api.github.com/users/gdpelican/gists{/gist_id}","starred_url":"https://api.github.com/users/gdpelican/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdpelican/subscriptions","organizations_url":"https://api.github.com/users/gdpelican/orgs","repos_url":"https://api.github.com/users/gdpelican/repos","events_url":"https://api.github.com/users/gdpelican/events{/privacy}","received_events_url":"https://api.github.com/users/gdpelican/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T08:53:09Z","updated_at":"2015-11-18T08:53:09Z","body":"We'll be working on this in the near future."}}