Railsでmemoizeを使う class User< ActiveRecord::Base extend ActiveSupport::Memoizable def memo p "memoize" "memo" end memoize :memo end