Ruby on Rails
Association Scope Plugin

Description

Example

post.rb:

 
class Post < ActiveRecord::Base
  with_association_scope :order => "created_at DESC", :dependent => :delete_all do
    # Both of these are ordered by created_at
    has_many :posts
    has_many :comments
    # And yes we can override default behaviour
    has_many :milestones, :order => "priority" 
  end

  # Don't use created_at for this one
  has_many :projects
end