Permalink
Browse files

Merge pull request #25 from ragaskar/master

Expand Rails 3.1 support
  • Loading branch information...
2 parents b182282 + 231b006 commit fddccccf3dec08d842b2bdbb5dcdbdfd35aefd15 @hosh hosh committed Jul 7, 2011
@@ -94,7 +94,7 @@ def reflection_table_name
end
def reflection_foreign_key
- reflection.primary_key_name.to_s
+ (reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name).to_s
end
def table_has_column?(klass, table_name, column)
@@ -214,7 +214,7 @@ def have_and_belong_to_many(*associations, &block)
end
# Ensures that the has_many relationship exists. Will also test that the
- # associated table has the required columns. It works by default with
+ # associated table has the required columns. It works by default with
# polymorphic association (:as does not have to be supplied).
#
# == Options
@@ -250,7 +250,7 @@ def have_many(*associations, &block)
end
# Ensures that the has_many relationship exists. Will also test that the
- # associated table has the required columns. It works by default with
+ # associated table has the required columns. It works by default with
# polymorphic association (:as does not have to be supplied).
#
# == Options

0 comments on commit fddcccc

Please sign in to comment.