Fix deprecation warning on Rails 3.2

This commit is contained in:
Elliot Winkler 2014-11-02 12:41:52 -07:00
parent fc3bb53a46
commit 7ef3cb6c19
1 changed files with 3 additions and 3 deletions

View File

@ -48,10 +48,10 @@ module Shoulda
def foreign_key
if has_and_belongs_to_many_reflection
has_and_belongs_to_many_reflection.foreign_key
elsif reflection.respond_to?(:primary_key_name)
reflection.primary_key_name
else
elsif reflection.respond_to?(:foreign_key)
reflection.foreign_key
else
reflection.primary_key_name
end
end