Class: PassiveRecord::Associations::HasOneAssociation

Inherits:
Struct
  • Object
show all
Defined in:
lib/passive_record/associations/has_one.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#child_class_nameObject

Returns the value of attribute child_class_name

Returns:

  • (Object)

    the current value of child_class_name



3
4
5
# File 'lib/passive_record/associations/has_one.rb', line 3

def child_class_name
  @child_class_name
end

#child_name_symObject

Returns the value of attribute child_name_sym

Returns:

  • (Object)

    the current value of child_name_sym



3
4
5
# File 'lib/passive_record/associations/has_one.rb', line 3

def child_name_sym
  @child_name_sym
end

#parent_classObject

Returns the value of attribute parent_class

Returns:

  • (Object)

    the current value of parent_class



3
4
5
# File 'lib/passive_record/associations/has_one.rb', line 3

def parent_class
  @parent_class
end

Instance Method Details

#children_name_symObject



12
# File 'lib/passive_record/associations/has_one.rb', line 12

def children_name_sym; child_name_sym end

#target_name_symbolObject



8
9
10
# File 'lib/passive_record/associations/has_one.rb', line 8

def target_name_symbol
  child_name_sym
end

#to_relation(parent_model) ⇒ Object



4
5
6
# File 'lib/passive_record/associations/has_one.rb', line 4

def to_relation(parent_model)
  HasOneRelation.new(self, parent_model)
end