Created
January 25, 2012 11:45
-
-
Save dfranciosi/1675915 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
if @related_products | |
# delete related not in the current marketplace | |
@related_products.delete_if do |p| | |
p.nil? || !p.marketplace_ids.include?(@marketplace.id) | |
end | |
# delete related not in order | |
@related_products.delete_if do |p| | |
p.marketplaces_products.find_by_product_id(p, :conditions => [ "product_order < 0" ]) ? true : false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment