title: Using Multiple Rails ActiveStorage Services
body: <p>I am using ActiveStorage for uploading PDFs and images. The PDFs need to be stored locally because of some privacy concerns, while the images need to be stored using Amazon S3. However, it looks like ActiveStorage only supports setting one service type per environment <em>(unless you use the mirror functionality, which doesn't do what I need it to in this case)</em>.</p>
  
  <p>Is there a way to use different service configs within the same environment? For example, if a model <code>has_one_attached pdf</code> it uses the local service:</p>
  
  <pre><code>local:
    service: Disk
    root: &lt;%= Rails.root.join("storage") %&gt;
  </code></pre>
  
  <p>And if another model <code>has_one_attached image</code> it uses the amazon service:</p>
  
  <pre><code>amazon:
    service: S3
    access_key_id: ""
    secret_access_key: ""
  </code></pre>