環境 Rails 3.0.8 確認用モデル生成 author $ rails g model author name:string book $ rails g model book author:references title:string price:integerauthor:referencesで生成するとBookモデルはbelongs_to :author ができます。 class Book < ActiveRecord::Base belongs_to :author end モデルのnamed_scope author class Author < ActiveRecord::Base scope :name_is, lambda {|n| where :name => n} end book class Book < ActiveRecord::Base belongs_