diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-13 13:29:33 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-13 13:29:33 -0800 |
commit | 99816bf8cc452b1c64ea76d510306f00d22122fd (patch) | |
tree | 41e4d48d1a542758a7a4e118a052ced15b58a5ed | |
parent | 761b0d98f7374c50f1256ff2b4c25c6c843dba4b (diff) | |
download | rails-99816bf8cc452b1c64ea76d510306f00d22122fd.tar.gz rails-99816bf8cc452b1c64ea76d510306f00d22122fd.tar.bz2 rails-99816bf8cc452b1c64ea76d510306f00d22122fd.zip |
deprecating Arel::Table#primary_key
-rw-r--r-- | History.txt | 3 | ||||
-rw-r--r-- | lib/arel/table.rb | 6 |
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 |