Permalink
Browse files

deprecating Arel::Table#primary_key

  • Loading branch information...
1 parent 761b0d9 commit 99816bf8cc452b1c64ea76d510306f00d22122fd @tenderlove tenderlove committed Dec 13, 2010
Showing with 9 additions and 0 deletions.
  1. +3 −0 History.txt
  2. +6 −0 lib/arel/table.rb
View
@@ -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
View
@@ -27,6 +27,12 @@ def initialize name, engine = Table.engine
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

3 comments on commit 99816bf

Member

vipulnsward replied Nov 16, 2013

@tenderlove why was this deprecated? Need to handle some warnings arising from this. Would love to provide some alternative.

Owner

tenderlove replied Nov 16, 2013

Member

vipulnsward replied Nov 16, 2013

The problem I was trying to solve was for ActiveRecord. AR is using compile_update and has started to throw warnings from here. Any way I could help to solve this?

Please sign in to comment.