Advertisement
Guest User

Untitled

a guest
May 27th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. # remove first seeded data with wrong collar option
  2. p=Spree::Product.find_by(slug: "body_satchel")
  3. variant_ids=p.variants.select{|v| v.option_value_ids.count == 1}.map(&:id)
  4. Spree::Variant.where(id: variant_ids).each do |variant|
  5. variant.really_destroy!
  6. end
  7.  
  8. # reupload broken body pov image
  9. pov=p.master.point_of_views.where(seen_from: "angled").first
  10. asset=p.master.original_assets.where(point_of_view_id: pov.id).first
  11. pov.image.update_attribute(:attachment, URI.parse(asset.attachment.url(:size1800)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement