Class: DatastaxRails::Associations::Builder::SingularAssociation

Inherits:
Association show all
Defined in:
lib/datastax_rails/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, #initialize, #mixin

Constructor Details

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

Instance Method Details

#buildObject


15
16
17
18
19
# File 'lib/datastax_rails/associations/builder/singular_association.rb', line 15

def build
  relation = super
  configure_denorm
  relation
end

#constructable?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'lib/datastax_rails/associations/builder/singular_association.rb', line 6

def constructable?
  true
end

#define_accessorsObject


10
11
12
13
# File 'lib/datastax_rails/associations/builder/singular_association.rb', line 10

def define_accessors
  super
  define_constructors if constructable?
end