Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9089661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:12:08+00:00 2026-06-16T22:12:08+00:00

I have a method to duplicate images in Carrierwave but receive the error Validation

  • 0

I have a method to duplicate images in Carrierwave but receive the error Validation failed: Image could not download file when I run it. It creates a copy of Invoice, then goes through it’s associated images, sets them as a remote_image_url and should re-upload them.

I believe it has something to do with the fact that there’s AccessKey information at the end of an image url. Any idea?

  def self.duplicate_it(invoice)

    new_invoice = invoice.dup
    new_invoice.save

    if invoice.images.any?
      invoice.images.each do |i|
        temp_image = i.image

        new_image = Image.new(:remote_image_url => temp_image.to_s, :order_id => new_invoice.id)
        new_image.save!
      end
    end 

  end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:12:09+00:00Added an answer on June 16, 2026 at 10:12 pm

    This worked

    new_invoice = invoice.dup :include => {:lineitems => :images} do |original, kopy|
      kopy.image = original.image if kopy.is_a?(Image)
    end 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´ve tryed to receive a image, decode and save in Documents file but i
Possible Duplicate: When to store images in a database(mySQL) and when not? (Linking image
Possible Duplicate: Bind multiple events to jQuery 'live' method I have the following function:
Possible Duplicate: Define a method that has many (or infinite) arguments I have the
Possible Duplicate: How can I upload files asynchronously with JQuery? I have a file
Possible Duplicate: Undefined index: file Hi I'm learning right now how to upload images
Possible Duplicate: Overloading member methods with typedef aliases as parameters I have following method
I have looked into this fairly extensively, but have not found quite what I
Possible Duplicate: How do I abort/cancel TPL Tasks? I have a method that takes
Possible Duplicate: AJAX- response data not saved to global scope? I basically have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.