サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
買ってよかったもの
blog.dalethatcher.com
ActiveRecord::Base doesn't always use new to create objects, so initialize might not be called. I wanted to use a Hash on an ActiveRecord::Base subclass to store some calculated values, so I naively did this: class User < ActiveRecord::Base def initialize(args = nil) super @my_cache = {} end endHowever I quickly ran into some "You have a nil object when you didn't expect it!" issues. Some debugger
このページを最初にブックマークしてみませんか?
『blog.dalethatcher.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く