Class: Syncano::ActiveRecord::Association::HasOne

Inherits:
Base
  • Object
show all
Defined in:
lib/syncano/active_record/association/has_one.rb

Overview

Class for has one association

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#belongs_to?, #has_many?, #initialize

Constructor Details

This class inherits a constructor from Syncano::ActiveRecord::Association::Base

Instance Attribute Details

#associated_modelObject

Returns the value of attribute associated_model.



8
9
10
# File 'lib/syncano/active_record/association/has_one.rb', line 8

def associated_model
  @associated_model
end

#foreign_keyObject

Returns the value of attribute foreign_key.



8
9
10
# File 'lib/syncano/active_record/association/has_one.rb', line 8

def foreign_key
  @foreign_key
end

#source_modelObject

Returns the value of attribute source_model.



8
9
10
# File 'lib/syncano/active_record/association/has_one.rb', line 8

def source_model
  @source_model
end

Instance Method Details

#has_one?TrueClass

Checks if association is has_one type

Returns:

  • (TrueClass)


12
13
14
# File 'lib/syncano/active_record/association/has_one.rb', line 12

def has_one?
  true
end