Skip to content

Instantly share code, notes, and snippets.

@spree
Created March 5, 2009 22:59
Show Gist options
  • Save spree/74625 to your computer and use it in GitHub Desktop.
Save spree/74625 to your computer and use it in GitHub Desktop.
def collection
@search = Order.new_search(params[:search])
if params[:search].nil? || params[:search][:conditions].nil?
@search.conditions.checkout_complete = true
end
@search.order_by ||= :created_at
@search.order_as ||= "DESC"
@search.per_page = Spree::Config[:orders_per_page]
@collection = @search.find(:all, :include => [:user, :shipments, {:creditcards => :address}] )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment