Class: DuckRecord::Associations::Builder::HasOne
- Inherits:
-
SingularAssociation
- Object
- Association
- SingularAssociation
- DuckRecord::Associations::Builder::HasOne
- Defined in:
- lib/duck_record/associations/builder/has_one.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Association
Class Method Summary collapse
Methods inherited from SingularAssociation
define_accessors, define_constructors
Methods inherited from Association
build, create_reflection, define_accessors, define_callbacks, define_extensions, define_readers, define_writers, valid_options, validate_options
Class Method Details
.define_validations(model, reflection) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/duck_record/associations/builder/has_one.rb', line 7 def self.define_validations(model, reflection) super if reflection.[:required] model.validates_presence_of reflection.name, message: :required end end |
.macro ⇒ Object
3 4 5 |
# File 'lib/duck_record/associations/builder/has_one.rb', line 3 def self.macro :has_one end |