Method: ActiveRecord::Associations::CollectionAssociation#reader

Defined in:
lib/active_record/associations/collection_association.rb

#reader(force_reload = false) ⇒ Object

Implements the reader method, e.g. foo.items for Foo.has_many :items



30
31
32
33
34
35
36
37
38
# File 'lib/active_record/associations/collection_association.rb', line 30

def reader(force_reload = false)
  if force_reload
    klass.uncached { reload }
  elsif stale_target?
    reload
  end

  @proxy ||= CollectionProxy.new(klass, self)
end