1
2
3
4
5
6
7
8
9
class Organization < ActiveRecord::Base
named_scope :active, :conditions => "status = ‘1′"
end
 
class OrganizationsController < ApplicationController
def index
@organizations = Organizations.active.paginate(:page => params[:page])
end
end

Namedscopes are soo pretteh