APIdock / Ruby on Rails
/
Browse About
method

inverse_name

rails latest stable - Class: ActiveRecord::Reflection::AssociationReflection
inverse_name()
private

Attempts to find the inverse association name automatically. If it cannot find a suitable inverse association name, it returns nil.

# File activerecord/lib/active_record/reflection.rb, line 699
        def inverse_name
          unless defined?(@inverse_name)
            @inverse_name = options.fetch(:inverse_of) { automatic_inverse_of }
          end

          @inverse_name
        end

Related methods

  • Instance methods
  • active_record_primary_key
  • add_as_polymorphic_through
  • add_as_source
  • add_as_through
  • association_class
  • association_foreign_key
  • association_primary_key
  • association_scope_cache
  • belongs_to?
  • check_eager_loadable!
  • check_validity!
  • clear_association_scope_cache
  • collect_join_chain
  • collection?
  • compute_class
  • extensions
  • foreign_key
  • has_inverse?
  • has_one?
  • has_scope?
  • join_foreign_key
  • join_id_for
  • join_primary_key
  • join_primary_type
  • join_table
  • macro
  • nested?
  • polymorphic?
  • polymorphic_inverse_of
  • polymorphic_name
  • source_reflection
  • through_reflection
  • validate?
  • Class methods
  • new
  • Private methods
  • privateactual_source_reflection
  • privateautomatic_inverse_of
  • privatecan_find_inverse_of_automatically?
  • privatecollect_join_reflections
  • privateconstraints
  • privatederive_class_name
  • privatederive_fk_query_constraints
  • privatederive_foreign_key
  • privateinverse_name
  • privatescope_allows_automatic_inverse_of?
  • privatesource_options
  • privatesource_reflection_name
  • privatesource_reflection_names
  • privatethrough_options
  • privatevalid_inverse_reflection?
APIdock API Documentation Browser

Implement the SPACE framework the right way with Swarmia.

© 2026 APIdock