Class: ActiveRecord::Associations::Builder::HasOne
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- ActiveRecord::Associations::Builder::HasOne
- Defined in:
- activerecord/lib/active_record/associations/builder/has_one.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from Association
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from SingularAssociation
define_accessors, define_constructors
Methods inherited from Association
build, #build, create_builder, define_accessors, define_callbacks, #define_extensions, define_readers, define_writers, #initialize, #validate_options
Constructor Details
This class inherits a constructor from ActiveRecord::Associations::Builder::Association
Class Method Details
.valid_dependent_options ⇒ Object
13 14 15 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 13 def self. [:destroy, :delete, :nullify, :restrict_with_error, :restrict_with_exception] end |
Instance Method Details
#macro ⇒ Object
3 4 5 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 3 def macro :has_one end |
#valid_options ⇒ Object
7 8 9 10 11 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 7 def valid = super + [:order, :as] valid += [:through, :source, :source_type] if [:through] valid end |