Skip to content

Instantly share code, notes, and snippets.

@turbod
Created March 17, 2014 12:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save turbod/9598349 to your computer and use it in GitHub Desktop.
Save turbod/9598349 to your computer and use it in GitHub Desktop.
Copy carrierwave files to another model
original_solution.files.each do |original_file|
f = original_file.dup
f.remote_name_url = original_file.name.url
new_solution.files << f
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment