Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

primary_key_name is deprecated in Rails 3.1 #20

Merged
merged 1 commit into from

2 participants

@bhushangahire

just want to report that primary_key_name. sorry, iam not able right now to provide a patch. i think its in

DEPRECATION WARNING: primary_key_name is deprecated and will be removed from Rails 3.2 (use foreign_key instead).
@sdsykes sdsykes merged commit 4e8adf6 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/slim_scrooge/callsite.rb
View
2  lib/slim_scrooge/callsite.rb
@@ -56,7 +56,7 @@ def initialize(model_class)
def essential_columns(model_class)
model_class.reflect_on_all_associations.inject([@primary_key]) do |arr, assoc|
if assoc.options[:dependent] && assoc.macro == :belongs_to
- arr << assoc.primary_key_name
+ arr << assoc.respond_to?(:foreign_key) ? assoc.foreign_key : assoc.primary_key_name
end
arr
end
Something went wrong with that request. Please try again.