Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Created February 23, 2010 20:48
Show Gist options
  • Select an option

  • Save rubysolo/312685 to your computer and use it in GitHub Desktop.

Select an option

Save rubysolo/312685 to your computer and use it in GitHub Desktop.
def applicable?(order)
self.active? &&
(self.effective_at..self.end_at).include?(Date.today) &&
order.detail_total > minimum_order_total &&
compatible?(order.applied_discounts.dup.reject{|d| d == self }) &&
! allowed_details(order).empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment