method

derive_primary_key_name

Importance_0
v3.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::Reflection::AssociationReflection
derive_primary_key_name() 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/reflection.rb, line 315
        def derive_primary_key_name
          if belongs_to?
            "#{name}_id"
          elsif options[:as]
            "#{options[:as]}_id"
          else
            active_record.name.foreign_key
          end
        end
Register or log in to add new notes.