Skip to content

Commit

Permalink
Added branching BC code for AssociationReflection for 2.1-stable support
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Oct 7, 2008
1 parent f1da64b commit 80c43d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion init.rb
@@ -1,4 +1,10 @@
require 'nested_has_many_through'

ActiveRecord::Associations::HasManyThroughAssociation.send :include, NestedHasManyThrough::Association
ActiveRecord::Reflection::ThroughReflection.send :include, NestedHasManyThrough::Reflection

# BC
if defined?(ActiveRecord::Reflection::ThroughReflection)
ActiveRecord::Reflection::ThroughReflection.send :include, NestedHasManyThrough::Reflection
else
ActiveRecord::Reflection::AssociationReflection.send :include, NestedHasManyThrough::Reflection
end

0 comments on commit 80c43d8

Please sign in to comment.