method
primary_key=
v3.2.8 -
Show latest stable
-
0 notes -
Class: ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods
- 1.0.0
- 1.1.0
- 1.1.1
- 1.1.6
- 1.2.0
- 1.2.6
- 2.0.0
- 2.0.1
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.2
- 2.3.8
- 3.0.0 (0)
- 3.0.5 (0)
- 3.0.7 (0)
- 3.0.9 (8)
- 3.1.0 (-6)
- 3.2.1 (38)
- 3.2.3 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- What's this?
primary_key=(value)
public
Sets the name of the primary key column.
class Project < ActiveRecord::Base self.primary_key = "sysid" end
You can also define the primary_key method yourself:
class Project < ActiveRecord::Base def self.primary_key "foo_" + super end end Project.primary_key # => "foo_id"


