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:
parent
761b0d98f7
commit
99816bf8cc
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue