instance method reload

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

reload(options = nil)

Reloads the attributes of this object from the database. The optional options argument is passed to find when reloading so you may do e.g. record.reload(:lock => true) to reload the same record with an exclusive row lock.

Parameters

options opt = nil
Source
# File activerecord/lib/active_record/base.rb, line 2536
      def reload(options = nil)
        clear_aggregation_cache
        clear_association_cache
        @attributes.update(self.class.find(self.id, options).instance_variable_get('@attributes'))
        @attributes_cache = {}
        self
      end

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

Defined in ActiveRecord::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close