instance method
id
Ruby on Rails 8.1.2
Since v3.2.22.5Signature
id()
Returns the primary key column’s value. If the primary key is composite, returns an array of the primary key column values.
Source
# File activerecord/lib/active_record/attribute_methods/primary_key.rb, line 18
def id
_read_attribute(@primary_key)
end
Defined in activerecord/lib/active_record/attribute_methods/primary_key.rb line 18
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::PrimaryKey