2007-10-25から1日間の記事一覧

Ruby は property ではなく attribute

アクセサメソッドを簡単定義するには,attr_accessor メソッドを使う. class foo @bar = 0 attr_accessor :bar def f = foo.new f.bar = 10 p f.bar #=> 10

has_many :through で associations までとってくるには.

なんとなくこんな感じ. user = User.find(1) user.books.find(:all, :include => [:associations])

cacheを削除するには

rake tmp:cache:clear 更新されなくて悩んだorz.