APIdock / Ruby on Rails
/
Browse About
method

target=

v6.0.0 - Show latest stable - Class: ActiveRecord::Associations::Association
target=(target)
public

Sets the target of this association to \target, and the loaded flag to true.

# File activerecord/lib/active_record/associations/association.rb, line 92
      def target=(target)
        @target = target
        loaded!
      end

Related methods

  • Instance methods
  • create
  • create!
  • extensions
  • initialize_attributes
  • inversed_from
  • inversed_from_queries
  • klass
  • load_target
  • loaded!
  • loaded?
  • marshal_dump
  • marshal_load
  • reload
  • remove_inverse_instance
  • reset
  • reset_scope
  • scope
  • set_inverse_instance
  • set_inverse_instance_from_queries
  • stale_target?
  • target=
  • Class methods
  • new
  • Private methods
  • privateassociation_scope
  • privatebuild_record
  • privatecreation_attributes
  • privatefind_target
  • privatefind_target?
  • privateforeign_key_for?
  • privateforeign_key_present?
  • privateinverse_association_for
  • privateinverse_reflection_for
  • privateinvertible_for?
  • privateraise_on_type_mismatch!
  • privatescope_for_create
  • privateset_owner_attributes
  • privateskip_statement_cache?
  • privatestale_state
  • privatetarget_scope
APIdock API Documentation Browser

© 2026 APIdock