Created
April 25, 2013 00:37
-
-
Save jsqu99/5456704 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locations = CampLocation.unscoped.where("name like '%ustin%'") | |
location_option_values = [] | |
locations.each do |location| | |
begin | |
location_option_values << Spree::OptionValue.unscoped.find(location.location_option_value_id) | |
rescue => error | |
puts "trouble with location: #{location.id} - #{location.name} - #{error}" | |
end | |
end | |
catch :finished do | |
Spree::Product.unscoped.all.each do |product| | |
product.option_values.each do |pov| | |
location_option_values.each do |lov| | |
if pov == lov | |
puts "\n\n\n MATCH for product: #{product.name} on #{lov.id} \n\n\n" | |
throw :finished | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment