Method: ActiveRecord::Associations::SingularAssociation#reader

Defined in:
activerecord/lib/active_record/associations/singular_association.rb

#readerObject

Implements the reader method, e.g. foo.bar for Foo.has_one :bar



7
8
9
10
11
12
13
# File 'activerecord/lib/active_record/associations/singular_association.rb', line 7

def reader
  if !loaded? || stale_target?
    reload
  end

  target
end