Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class Product < ActiveRecord::Base named_scope :online, :conditions => {:status => 1}, :include => [:variants, :catalogue_images, :categories] named_scope :from_category_ids, lambda { |cat_ids| {:conditions => "categories_products.category_id IN (#{cat_ids})", :include => :categories }} end class CatalogueController < RaidBase def category @products = Product.from_category_ids(@category.leaf_ids).online.paginate :page => params[:page], :per_page => params[:per_page] end end
This paste will be private.
From the Design Piracy series on my blog: