Notes posted by roryokane
RSS feedLocation of this method in older versions
Before v3.2.1, this method was in ActiveRecord::Base.create .
Where this method moved to
After v3.1.0, this method moved to ActiveRecord::Persistence::ClassMethods#create .
rest of code is in Object#try
The logic for #try is shared between this method and Object#try – “Show source” here doesn’t show the whole story. Both methods are currently implemented in the file activesupport/lib/active_support/core_ext/object/try.rb .
rest of code is in NilClass#try
If you click “Show source” here, you may get confused. The logic for #try is shared between this method and NilClass#try . Both versions are currently implemented in the file activesupport/lib/active_support/core_ext/object/try.rb .
this has been deprecated; see linked note
This has been deprecated. See this note on memoize : http://apidock.com/rails/ActiveSupport/Memoizable/memoize#1317-this-has-been-deprecated-replace-with-Memoist
this has been deprecated; replace with Memoist
In Rails 3.2, memoize has been deprecated. In edge Rails, it has been removed.
The commit when it was deprecated: http://github.com/rails/rails/commit/36253916b0b788d6ded56669d37c96ed05c92c5c
A Stack Overflow question about this change: http://stackoverflow.com/q/9132197/578288
I personally disagree with the removal of memoize, and don’t recommend using the `||=` pattern Rails now suggests. The exception is if your entire program only memoizes something once or twice, so it’s not worth including a gem for.
The easiest way to keep using memoize is to use the Memoist gem (http://github.com/matthewrudy/memoist , http://rubygems.org/gems/memoist), which is a simple extraction of ActiveSupport::Memoizable into its own gem.
see also – similar methods
See also DateTime#strftime and Date#strftime . (They work similarly, but have different APIdock notes.)
see also – similar methods
See also Time#strftime and DateTime#strftime . (They work similarly, but have different APIdock notes.)
see also – similar methods
See also Time#strftime and Date#strftime . (They work similarly, but have different APIdock notes.)
method to use instead
This may be obvious, but the replacement for this method is csrf_meta_tags.