Flowdock
method

get_primary_key

Importance_0
Ruby on Rails latest stable (v4.0.2) - 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 83
        def get_primary_key(base_name) #:nodoc:
          return 'id' if base_name.blank?

          case primary_key_prefix_type
          when :table_name
            base_name.foreign_key(false)
          when :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.