method

find_target

Importance_0
v3.0.9 - Show latest stable - 0 notes - Class: ActiveRecord::Associations::BelongsToPolymorphicAssociation
find_target() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb, line 51
        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
Register or log in to add new notes.