Class: ActiveRecord::Associations::Builder::SingularAssociation

Inherits:
Association show all
Defined in:
activerecord/lib/active_record/associations/builder/singular_association.rb

Overview

:nodoc:

Direct Known Subclasses

BelongsTo, HasOne

Instance Attribute Summary

Attributes inherited from Association

#model, #name, #options, #reflection

Instance Method Summary collapse

Methods inherited from Association

build, #build, #initialize

Constructor Details

This class inherits a constructor from ActiveRecord::Associations::Builder::Association

Instance Method Details

#constructable?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'activerecord/lib/active_record/associations/builder/singular_association.rb', line 5

def constructable?
  true
end

#define_accessorsObject



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

def define_accessors
  super
  define_constructors if constructable?
end