<p>This is a first draft for moving the user images to use Active Storage and is setup so that in production we can use an S3 backend for the storage.</p>
<p>New images are saved to Active Storage, and images from there are preferred, falling back to the old images if there isn't a suitable attachment.</p>
<p>Once this is merged and deployed we can use a background job to migrate the existing images and then remove the old paperclip based image support.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/2296'>https://github.com/openstreetmap/openstreetmap-website/pull/2296</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Add support for Active Storage attachments</li>
<li>Move user images to Active Storage with paperclip as a fallback</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-0">.gitignore</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-1">.travis.yml</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-2">Gemfile</a>
(3)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-3">Gemfile.lock</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-4">INSTALL.md</a>
(9)
</li>
<li>
<strong>R</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-5">app/assets/images/avatar_large.png</a>
(0)
</li>
<li>
<strong>R</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-6">app/assets/images/avatar_small.png</a>
(0)
</li>
<li>
<strong>R</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-7">app/assets/images/avatars.svg</a>
(0)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-8">app/assets/javascripts/user.js</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-9">app/controllers/users_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-10">app/helpers/user_helper.rb</a>
(26)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-11">app/mailers/notifier.rb</a>
(15)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-12">app/models/user.rb</a>
(5)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-13">app/views/api/users/_user.builder</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-14">app/views/users/account.html.erb</a>
(30)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-15">config/.gitignore</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-16">config/environments/production.rb</a>
(2)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-17">config/example.storage.yml</a>
(7)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-18">config/initializers/config.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-19">config/settings.yml</a>
(2)
</li>
<li>
<strong>D</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-20">config/storage.yml</a>
(34)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-21">db/migrate/20190702193519_create_active_storage_tables.rb</a>
(27)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-22">db/structure.sql</a>
(128)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-23">test/controllers/users_controller_test.rb</a>
(12)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296/files#diff-24">test/helpers/user_helper_test.rb</a>
(12)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2296.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2296.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2296.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2296.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2296?email_source=notifications&email_token=AAK2OLLOAX3AIKE6IEBUCGDP5PR27A5CNFSM4H5AU5HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5AFEVA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPRXR2CVZ4DTOIOM2LP5PR27ANCNFSM4H5AU5HA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLLNDPSCKQHN2LWXGSTP5PR27A5CNFSM4H5AU5HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5AFEVA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2296?email_source=notifications\u0026email_token=AAK2OLLOAX3AIKE6IEBUCGDP5PR27A5CNFSM4H5AU5HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5AFEVA",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2296?email_source=notifications\u0026email_token=AAK2OLLOAX3AIKE6IEBUCGDP5PR27A5CNFSM4H5AU5HKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5AFEVA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>