Skip to content

Instantly share code, notes, and snippets.

@rthbound
Created January 6, 2012 21:29
Show Gist options
  • Save rthbound/1572479 to your computer and use it in GitHub Desktop.
Save rthbound/1572479 to your computer and use it in GitHub Desktop.
named_scope :cart_products_not_empty,
:joins => :cart_products,
:group => 'cart_products.cart_id',
:having => "count(cart_products.cart_id) >= 1"
named_scope :cart_components_not_empty,
:joins => :cart_components,
:group => 'cart_components.cart_id',
:having => "count(cart_components.cart_id) >= 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment