Permalink
Browse files

Backport foreign_key/foreign_type to 3.0

  • Loading branch information...
1 parent d9ab4ab commit f0688901b176b928a65b5f53e2a5d5bd4f0bdca4 @ernie ernie committed Sep 3, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/squeel/adapters/active_record/3.0/compat.rb
@@ -196,3 +196,14 @@ def as other
end
end
+
+module ActiveRecord
+ module Reflection
+ class AssociationReflection < MacroReflection
+ alias :foreign_key :primary_key_name
+ def foreign_type
+ options[:foreign_type]
+ end
+ end
+ end
+end

0 comments on commit f068890

Please sign in to comment.