instance method
id
Ruby on Rails 4.2.9
Since v3.2.22.5Signature
id()
Returns the primary key value.
Source
# File activerecord/lib/active_record/attribute_methods/primary_key.rb, line 17
def id
if pk = self.class.primary_key
sync_with_transaction_state
_read_attribute(pk)
end
end
Defined in activerecord/lib/active_record/attribute_methods/primary_key.rb line 17
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AttributeMethods::PrimaryKey