public
Description: Rails Plugin: macros for adding attribute-specific scopes and orderings to ActiveRecord models
Homepage:
Clone URL: git://github.com/duncanbeevers/named_scope_for.git
name age message
file README Loading commit data...
file init.rb
README
Macro for generating attribute-specific selector scopes.

Similar to find_by_attribute methods, these macros provide a more flexible scoping.

  class User < ActiveRecord::Base
    named_scope_for :group_id
  end

  User.for_group_id(10).find(:all)

Also provides `order_by` scope that allows you to add order constraints to a query cleanly.

  User.order_by('created_at DESC', 'id')