aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--History.txt3
-rw-r--r--lib/arel/table.rb6
2 files changed, 9 insertions, 0 deletions
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