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
#model, #name, #options, #scope
Instance Method Summary collapse
- #configure_dependency ⇒ Object
- #constructable? ⇒ Boolean
- #macro ⇒ Object
- #valid_dependent_options ⇒ Object
- #valid_options ⇒ Object
Methods inherited from SingularAssociation
#define_accessors, #define_constructors
Methods inherited from Association
build, #build, #define_accessors, #define_readers, #define_writers, #initialize, #mixin, #validate_options
Constructor Details
This class inherits a constructor from ActiveRecord::Associations::Builder::Association
Instance Method Details
#configure_dependency ⇒ Object
17 18 19 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 17 def configure_dependency super unless [:through] end |
#constructable? ⇒ Boolean
13 14 15 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 13 def constructable? ![:through] end |
#macro ⇒ Object
3 4 5 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 3 def macro :has_one end |
#valid_dependent_options ⇒ Object
21 22 23 |
# File 'activerecord/lib/active_record/associations/builder/has_one.rb', line 21 def [:destroy, :delete, :nullify, :restrict_with_error, :restrict_with_exception] 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 |