Module ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods
In: lib/active_record/attribute_methods/primary_key.rb

Methods

Public Instance methods

Defines the primary key field — can be overridden in subclasses. Overwriting will negate any effect of the primary_key_prefix_type setting, though.

primary_key=(value = nil, &block)

Alias for set_primary_key

Sets the name of the primary key column to use to the given value, or (if the value is nil or false) to the value returned by the given block.

  class Project < ActiveRecord::Base
    set_primary_key "sysid"
  end

[Validate]