class Dynamoid::Associations::HasOne
@private
Private Instance Methods
target_association()
click to toggle source
Find the target association, always a :belongs_to association. Uses either options or the source class name and default parsing to return the most likely name for the target association.
@since 0.2.0
# File lib/dynamoid/associations/has_one.rb, line 17 def target_association key_name = options[:inverse_of] || source.class.to_s.singularize.underscore.to_sym guess = target_class.associations[key_name] return nil if guess.nil? || guess[:type] != :belongs_to key_name end