Skip to content


has_many_polymorphs broken for Rails 2.1.x

The guys on has_many_polymorphs are doing a great job keeping the plugin up to date with edge Rails.

This commit broke the plugin with Rails 2.1.x

NameError: uninitialized constant ActiveRecord::Reflection::ClassMethods::ThroughReflection

Just revert to the AssociationReflection instead of ThroughReflection logic and all should be fine.

Posted in Ruby.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. melinda says

    Tamer: I’m a bit of a noob, and getting this error while trying to install the tags extension.

    but I do not understand how to ‘revert to the AssociationReflection instad of ThroughReflection logic’. Is this a different commit that I should check out? Or do I need to edit something?

  2. Tamer says

    @melinda
    In lib/has_many_polymorphs/reflection.rb of your plugin; try replacing those two lines

    klass = options[:through] ? ThroughReflection : AssociationReflection
    reflection = klass.new(macro, name, options, active_record)

    with

    reflection = AssociationReflection.new(macro, name, options, active_record)

    And see if that would work



Some HTML is OK

or, reply to this post via trackback.