method
primary_key
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: ActiveRecord::ConnectionAdapters::SQLite3Adapter
primary_key(table_name)
public
Hide source
# File activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb, line 416 def primary_key(table_name) #:nodoc: pks = table_structure(table_name).select { |f| f['pk'] > 0 } return nil unless pks.count == 1 pks[0]['name'] end