Skip to content

Instantly share code, notes, and snippets.

@railsdog
Created February 22, 2009 00:55
Show Gist options
  • Save railsdog/68271 to your computer and use it in GitHub Desktop.
Save railsdog/68271 to your computer and use it in GitHub Desktop.
def available?(order)
special_categories = ShippingCategory.find(:all, :conditions => ["name IN ('TV', 'Medium Size TV', 'Oversized TV')"])
order.line_items.each do |line_item|
product = line_item.variant.product
return false if special_categories.include?(product.shipping_category)
end
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment