From 99816bf8cc452b1c64ea76d510306f00d22122fd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 13 Dec 2010 13:29:33 -0800 Subject: [PATCH] deprecating Arel::Table#primary_key --- History.txt | 3 +++ lib/arel/table.rb | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/History.txt b/History.txt index 6094c7f6ca..d16baa5b30 100644 --- a/History.txt +++ b/History.txt @@ -27,6 +27,9 @@ * Arel::Nodes::And.new takes a single list instead of left and right. + * Arel::Table#primary_key is deprecated and will be removed in 3.0.0 with no + replacement. + == 2.0.7 (unreleased) * Bug Fixes diff --git a/lib/arel/table.rb b/lib/arel/table.rb index ceb81705b3..a68705fedf 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -27,6 +27,12 @@ module Arel end def primary_key + if $VERBOSE + warn <<-eowarn +primary_key (#{caller.first}) is deprecated and will be removed in ARel 3.0.0. Please +switch to `compile_insert` + eowarn + end @primary_key ||= begin primary_key_name = @engine.connection.primary_key(name) # some tables might be without primary key