Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

A migration guide from Paperclip to ActiveStorage #2568

Merged
merged 3 commits into from Mar 9, 2018

Commits on Mar 9, 2018

  1. A migration guide from Paperclip to ActiveStorage

    A start at an introductory migration path for moving from Paperclip to
    [ActiveStorage].
    
    ActiveStorage is coming in Rails 5.2 (April, perhaps) and we want to
    help people move from Paperclip to it. Having a file upload strategy
    baked into Rails itself will allow us all to focus our efforts and
    follow a common goal.
    
    This migration guide is rudimentary at best: it works for a `User`
    object with one `avatar` attachment. It is provided as a framework to
    start the documentation.
    
    I have tried this in a dummy app.
    
    [ActiveStorage]: http://edgeguides.rubyonrails.org/active_storage_overview.html
    mike-burns committed Mar 9, 2018
    Copy the full SHA
    bc6d35b View commit details
    Browse the repository at this point in the history
  2. Updates from review

    - open-uri is a security concern, so let's not recommend it. Separate
    one-liners based on whether they're doing local or remote storage.
    - Mention the performance impact of the separate table. While migrating
    they will want to consider each use case for n+1 loads.
    
    Thanks, Derek!
    mike-burns committed Mar 9, 2018
    Copy the full SHA
    34f05ad View commit details
    Browse the repository at this point in the history
  3. Remove stray newline

    mike-burns committed Mar 9, 2018
    Copy the full SHA
    be23fbf View commit details
    Browse the repository at this point in the history