instance method cache_attributes

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

cache_attributes(*attribute_names)

cache_attributes allows you to declare which converted attribute values should be cached. Usually caching only pays off for attributes with expensive conversion methods, like time related columns (e.g. created_at, updated_at).

Parameters

attribute_names rest
Source
# File activerecord/lib/active_record/attribute_methods.rb, line 113
      def cache_attributes(*attribute_names)
        attribute_names.each {|attr| cached_attributes << attr.to_s}
      end

Defined in activerecord/lib/active_record/attribute_methods.rb line 113 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::AttributeMethods::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close