因此,在Rails 3.2中,ActiveSupp或t::Mem或izable已被弃用.
信息如下:
DEPRECATION WARNING: ActiveSupp或t::Memoizable is deprecated and
will be removed in future releases,simply use Ruby memoization
pattern instead.
它指的是"Ruby记忆模式"(单数),好像有一种模式我们都应该知道并参考...
我猜它们的意思是:
def my_method
@my_method ||= # ... go get the value
end
或
def my_method
return @my_method if defined?(@my_method)
@my_method = # ... go get the value
end
还有什么我错过的吗?