title: Attach images in seed.rb file in rails using active storage
body: <p>I have a class called vehicles which can have an image attached to it. I have made a default image to display if no other image was uploaded in the vehicles.rb file.</p>
  
  <p>I would like to include images in the seed.rb file so I don't have to manually upload all images. Is this possible?</p>
  
  <p>Help is much appreciated thanks.</p>
  
  <p>Here is my vehicle.rb:</p>
  
  <pre><code>class Vehicle &lt; ApplicationRecord
    belongs_to :make
    belongs_to :model
    accepts_nested_attributes_for :make
    accepts_nested_attributes_for :model
    has_one_attached :image
  
    after_commit :add_default_image, on: %i[create update]
  
    def add_default_image
      unless image.attached?
        image.attach(
          io: File.open(Rails.root.join('app', 'assets', 'images', 'no_image_available.jpg')),
          filename: 'no_image_available.jpg', content_type: 'image/jpg'
        )
      end
    end
  end
  </code></pre>
  
  <p>Here is how i am creating records in my seed file but I would like to include the images as well:</p>
  
  <pre><code>v = Vehicle.create(
    vin: '1QJGY54INDG38946',
    color: 'grey',
    make_id: m.id,
    model_id: mo.id,
    wholesale_price: '40,000'
  )
  </code></pre>