#798 ✓resolved
Don Ziesig

join table access broken in 1.3. worked in 1.0

Reported by Don Ziesig | September 24th, 2010 @ 11:35 PM | in Hobo 1.3 (Rails 3)

Implementing a join table between roles and permissions (really trivial stuff that I have been doing, in one form or another, from Rails 1.old)- using Hobo code lifted from the "Rapid Rails with Hobo" pdf book. The code worked fine in hobo 1.0 + Rails 2.3.8.

I just upgraded to Hobo 1.3 + Rails 3.0. Now the same code gives me a No Method Exception: "undefined method conditions for #Class:0xb639d580" when I try to add a new object from either side. I disabled the join code and entered some objects to see what would happen if I tried to edit them and I get the same exception. The exception occurs immediately upon selecting the links Edit XXXX or New XXXX.

the failing lines are:

in role.rb

  has_many :permissions, :through => :permission_roles, :accessible => true
  has_many :permission_roles, :dependent => :destroy

in permission.rb

  has_many :roles, :through => :permission_roles, :accessible => true
  has_many :permission_roles, :dependent => :destroy
in permission_role.rb
  belongs_to :role
  belongs_to :permission

I did some debugging and found that the failure occurs while looking for a regular expression preceeding "connections" (for example by_connections) but having only the symbol :connections as its argument.

The debugger backtrace was so deep that I gave up trying to isolate the code that is the source of the problem.

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

Referenced by

Pages