title: Cloudinary reverse photos order after create/update on production
body: <p>I'm using <a href="https://github.com/longform/cloudinary_gem" rel="nofollow noreferrer">cloudinary</a> and <a href="https://github.com/assembler/attachinary" rel="nofollow noreferrer">attachinary</a> gems to upload photos which will be exhibited on a carousel and the order is important to me. </p>
  
  <p>Update:</p>
  
  <p>What is happening is that when we call:</p>
  
  <pre><code>product = Product.find(id)
  product.photo.count # it returns many photos from attachinary
  &gt; 12
  first_photo = product.photo.first 
  </code></pre>
  
  <p>In production:</p>
  
  <ul>
  <li><code>first_photo</code> returns the last photo created (greater id number)</li>
  </ul>
  
  <p>In development/staging:</p>
  
  <ul>
  <li><code>first_photo</code> returns the first photo created (lesser id number)</li>
  </ul>
  
  <p>Atachinary creates this table:</p>
  
  <pre><code>  create_table "attachinary_files", force: :cascade do |t|
      t.string   "attachinariable_type"
      t.integer  "attachinariable_id"
      t.string   "scope"
      t.string   "public_id"
      t.string   "version"
      t.integer  "width"
      t.integer  "height"
      t.string   "format"
      t.string   "resource_type"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.index ["attachinariable_type", "attachinariable_id", "scope"], name: "by_scoped_parent", using: :btree
    end
  </code></pre>
  
  <p>Specs:</p>
  
  <ul>
  <li>Rails: 5.0.1</li>
  <li>Attachinary: 1.3.1</li>
  <li>Cloudinary: 1.1.1</li>
  </ul>
  
  <p>Table</p>
  
  <ul>
  <li>products</li>
  <li>attachinary field: photo</li>
  </ul>
  
  <p><strong>Product.rb</strong></p>
  
  <pre><code>has_attachments :photo, maximum: 20, accept: [:jpg, :jpeg, :jfif, :bmg, :bpg, :png]
  </code></pre>