#649 ✓resolved
comboy

has n, :through micro issue

Reported by comboy | November 11th, 2008 @ 04:16 AM

When somebody defines a has n, :through association and he doesn't define has many relation to the :through model, he got some strange errer about calling method name on nil object which may be confusing.

Maybe it's a good idea to let this bad coder know what may be wrong. It's probably not even worth creating a patch but something like


 if options[:through] && !relationships.keys.include?(options[:through])
   raise ArgumentError, "Relation '#{options[:through]}' not found.", caller
 end

in associations.rb in method "has" may do the job.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages