module ActiveModel::Associations::OverrideMethods

Public Instance Methods

_read_attribute(name)
Alias for: read_attribute
new_record?() click to toggle source

dummy

# File lib/active_model/associations/override_methods.rb, line 86
def new_record?
  false
end
read_attribute(name) click to toggle source
# File lib/active_model/associations/override_methods.rb, line 80
def read_attribute(name)
  send(name)
end
Also aliased as: _read_attribute

Private Instance Methods

association_instance_get(name) click to toggle source

use in Rails internal

# File lib/active_model/associations/override_methods.rb, line 102
def association_instance_get(name)
  @association_cache[name]
end
association_instance_set(name, association) click to toggle source

use in Rails internal

# File lib/active_model/associations/override_methods.rb, line 107
def association_instance_set(name, association)
  @association_cache[name] = association
end
validate_collection_association(reflection) click to toggle source

override

# File lib/active_model/associations/override_methods.rb, line 93
def validate_collection_association(reflection)
  if association = association_instance_get(reflection.name)
    if records = associated_records_to_validate_or_save(association, false, reflection.options[:autosave])
      records.each { |record| association_valid?(reflection, record) }
    end
  end
end