Flowdock
method

get_primary_key

Importance_0
Ruby on Rails latest stable (v4.2.1) - 0 notes - Class: ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods
get_primary_key(base_name) public

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/attribute_methods/primary_key.rb, line 91
        def get_primary_key(base_name) #:nodoc:
          if base_name && primary_key_prefix_type == :table_name
            base_name.foreign_key(false)
          elsif base_name && primary_key_prefix_type == :table_name_with_underscore
            base_name.foreign_key
          else
            if ActiveRecord::Base != self && table_exists?
              connection.schema_cache.primary_keys(table_name)
            else
              'id'
            end
          end
        end
Register or log in to add new notes.