Class: Pakyow::Data::Sources::Relational::Associations::BelongsTo Private

Inherits:
Pakyow::Data::Sources::Relational::Association show all
Defined in:
lib/pakyow/data/sources/relational/associations/belongs_to.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Pakyow::Data::Sources::Relational::Association

#associated_source, #associated_source_name, #name, #query, #source

Instance Method Summary collapse

Methods inherited from Pakyow::Data::Sources::Relational::Association

#dependent_source_names, #initialize, #internal!, #internal?

Constructor Details

This class inherits a constructor from Pakyow::Data::Sources::Relational::Association

Instance Method Details

#associated_query_fieldObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 36

def associated_query_field
  @associated_source.primary_key_field
end

#dependents?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


40
41
42
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 40

def dependents?
  false
end

#foreign_key_fieldObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 24

def foreign_key_field
  :"#{@name}_#{@associated_source.primary_key_field}"
end

#foreign_key_typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 28

def foreign_key_type
  @associated_source.primary_key_type
end

#query_fieldObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 32

def query_field
  foreign_key_field
end

#result_typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 20

def result_type
  :one
end

#specific_typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 16

def specific_type
  :belongs_to
end

#typeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
# File 'lib/pakyow/data/sources/relational/associations/belongs_to.rb', line 12

def type
  :belongs
end