- Where Developers Learn, Share, & Build Careers


I have an object with several organizations, some of which are related to paper clippings-attachments that are stored on S3. .

  copy_salon = @ salon.dup copy_salon: If I duplicate the item and associations it works fine but the attachments did not duplicate  

It works without getting images here .about_us_versions = @ salon.about_us_versions.collect {| About | About_us.dup}

I try to get this type of image link:

  copy_salon = @ salon.dup copy_salon.about_us_versions = @ salon.about_us_versions . Gathered {| About_us | About_us_dup = about_us.dup that about about_us.about_us_image about then_us_dup.about_us_image = about_us.about_us_image end about if about_us.team_image then_us_dup.team_image = about_us.team_image about_us_dup}   

But then I'm getting the error 'can not be converted into zero in string', probably because not all images are installed.

not understood, elegant but not working I hope SW all associations and attachments to my objects Will duplicate with There is no gem for that

  copy_salon = @ salon.dup copy_salon.about_us_versions = @ salon.about_us_versions.collect {|? About_us | about_us_dup = about_us.dup until about_us.about_us_image.url == "/about_us_images/original/missing.png" So about_us_dup.about_us_image = about_us.about_us_image end until about_us.team_image.url == "/ team_images / original / missing. Png "then about_us_dup.team_image = about_us.team_image end about_us_dup}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -