1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

deprecating Arel::Table#primary_key

This commit is contained in:
Aaron Patterson 2010-12-13 13:29:33 -08:00
parent 761b0d98f7
commit 99816bf8cc
2 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,9 @@
* Arel::Nodes::And.new takes a single list instead of left and right. * 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) == 2.0.7 (unreleased)
* Bug Fixes * Bug Fixes

View file

@ -27,6 +27,12 @@ module Arel
end end
def primary_key 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 ||= begin
primary_key_name = @engine.connection.primary_key(name) primary_key_name = @engine.connection.primary_key(name)
# some tables might be without primary key # some tables might be without primary key