method
find_target
v3.0.0 -
Show latest stable
-
0 notes -
Class: ActiveRecord::Associations::BelongsToPolymorphicAssociation
find_target()
private
Hide source
# File activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb, line 47 def find_target return nil if association_class.nil? target = if @reflection.options[:conditions] association_class.find( @owner[@reflection.primary_key_name], :select => @reflection.options[:select], :conditions => conditions, :include => @reflection.options[:include] ) else association_class.find(@owner[@reflection.primary_key_name], :select => @reflection.options[:select], :include => @reflection.options[:include]) end set_inverse_instance(target, @owner) target end