ruby '2.7.1' / rails 6.0.3.2
I can't get local active storage attachements to work. Here is my setup:
I have run:
$ rails active_storage:install
$ rake db:migrate
Model schema
create_table "amazon_uploads" do |t|
t.string "status"
t.string "order_csv"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
model:
class AmazonUpload < ApplicationRecord
has_many :amazon_upload_recipients
has_one_attached :order_csv
end
my storage.yml
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
my development.rb contains:
config.active_storage.service = :local
And then in my code I do:
file = File.open(updated_file_path)
@amazon_upload.order_csv.attach(io: file, filename: "hello", content_type: "application/CSV")
the last line fails with
NameError: uninitialized constant #<Class:0x0000564c2f7e8638>::Analyzable
The only other reference I can see to this error the person claims they had a type but I don't think that's the issue here