AutoScope =========== find, first, last, allの呼び出し時に自動的にNamed Scopeの呼び出しを行います. Example ======= Setting: AutoScope.configure do |c| c.attach(:company) c.attach(:department) end ActiveRecord::Schema.define(:version => 0) do create_table :people do |t| t.string :name t.string :company t.string :department t.timestamps end end class Person < ActiveRecord::Base auto_scope end 次に: pluginなどでアタッチしたNamed Scopeを記述します. すると: Person.find(:first, :conditions => {:name => 'alice'}) # => Person.company.department(:first, :conditions => ... ) Copyright (c) 2009 Good-Day, Inc