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
-
Domizio Demichelis September 29th, 2010 @ 05:19 PM
- State changed from new to open
- Milestone set to Hobo 1.3 (Rails 3)
- Assigned user set to Domizio Demichelis
- Milestone order changed from 197889 to 0
-
Domizio Demichelis October 2nd, 2010 @ 12:47 PM
- State changed from open to invalid
- Milestone cleared.
- Assigned user cleared.
see #804
-
Tom Locke October 4th, 2010 @ 05:01 PM
- State changed from invalid to open
(from [db652876290ac22f734fa50fbd93ead6257f37e6]) association.conditions is a private method [#804 state:open] [#798 state:open] http://github.com/tablatom/hobo/commit/db652876290ac22f734fa50fbd93...
-
Domizio Demichelis October 4th, 2010 @ 05:08 PM
- Milestone set to Hobo 1.3 (Rails 3)
- Assigned user set to Domizio Demichelis
- Milestone order changed from 3 to 0
Why the previous update is marked as a Tom's message? I did the commit and changed the state from the commit message. hmmmm
Anyway, I changed the calls to .conditions to .send(:conditions) so we can avoid the patch. Please check if it is working, so I can mark it as resolved. Thank you.
-
Domizio Demichelis October 4th, 2010 @ 09:59 PM
- State changed from open to resolved
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.
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
- 798 join table access broken in 1.3. worked in 1.0 (from [db652876290ac22f734fa50fbd93ead6257f37e6]) associa...
- 804 AssociationProxy#conditions is not callable (from [db652876290ac22f734fa50fbd93ead6257f37e6]) associa...