From 57155064d135d67e0624d561c2badfe018b27a3a Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 7 Jan 2016 16:38:39 -0600 Subject: Get update_attributes working with SchemaMigration You cannot use `update_attributes` on models that do not have a primary key. Since SchemaMigration versions are guaranteed to be unique (they have a unique index on them) we can safely use them as a primary key. --- activerecord/lib/active_record/schema_migration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/schema_migration.rb b/activerecord/lib/active_record/schema_migration.rb index 51b9b17395..3017ee0bbb 100644 --- a/activerecord/lib/active_record/schema_migration.rb +++ b/activerecord/lib/active_record/schema_migration.rb @@ -9,7 +9,7 @@ module ActiveRecord class SchemaMigration < ActiveRecord::Base # :nodoc: class << self def primary_key - nil + "version" end def table_name -- cgit v1.2.3