Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ActiveStorage Images #661

Open
kadirpace opened this issue Jan 8, 2020 · 3 comments
Open

Importing ActiveStorage Images #661

kadirpace opened this issue Jan 8, 2020 · 3 comments

Comments

@kadirpace
Copy link

I am trying to import products and save images through remote urls. Import works well, but I can't manage it to make it work work ActiveStorage images.

Is this supported in anyway? This is what I have

    product = Product.new(
        name: row['name'],
        sku: row['sku'],
        brand_id: row['brand']
    )
    product.image.attach(io: parsed_image_url, filename: row['sku']+ '.jpg', content_type: 'image/jpg')
    products << product
...
    importing = Product.import products, recursive: true

when I check the development logs, I don't see any actions for images.

@jkowens
Copy link
Collaborator

jkowens commented Jan 13, 2020

I've never tested with ActiveStorage specifically. I'd say it's very likely that support for ActiveStorage attachments would need to be added. Just to verify, you are using Postgres correct? The recursive option is only supported for Postgres databases.

@kadirpace
Copy link
Author

hi @jkowens, support would be nice. I believe many people are using Activestorage option these days.
yes, I am using Postgres database.

@jkowens
Copy link
Collaborator

jkowens commented Jan 15, 2020

I agree, if anyone can get a PR together for this in the near term that would be appreciated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants