Skip to content

Instantly share code, notes, and snippets.

@NeMO84
Created February 4, 2011 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeMO84/810655 to your computer and use it in GitHub Desktop.
Save NeMO84/810655 to your computer and use it in GitHub Desktop.
lib/active_record/connection_adapters/sqlserver_adapter.rb
def primary_key(table_name)
identity_column(table_name).try(:name) || columns(table_name).first.try(:name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment