Hi all!

I'm using Hobo as a plugin, from 
http://github.com/tablatom/hobo/commit/f97e0fdca694f6cf91550f8887f12af7e55325a9,
 but I had this issue with Hobo 1.0 as well.

I have Companies, People, Employees and Events. Events have company_id and 
person_id fields. UI-wise, I want the user to only have to do a single lookup 
to find the company, person or employee record. That part works just fine. My 
problem happens on subsequent edits.

In a nutshell, I get:

  NoMethodError: undefined method `get_field_path' for Hobo:Module

For the interested, I have code and backtrace information available at 
http://gist.github.com/

Debugging and tracing, I found that #can_view? is called with the value of my 
field. In my case, the value of the field happens to be a String, which might 
or might not contain a ".". If the #addressee_name contains a ".", I'm 
foobar'd: Hobo attemps to navigate an object hierarchy, and blows up as posted 
above. If the value is a simple string with no ".", the value is put in the 
INPUT, and all is fine.

Logging the #can_view? calls, I see the following:

#can_view?([#<Person id: 1216, last_name: "Sylvestre", first_name: 
"francois.b", address1: nil, address2: nil, address3: nil, postal_code: nil, 
home_number: nil, mobile_number: nil, email: nil, created_at: "2010-02-09 
17:48:57", updated_at: "2010-04-07 22:14:43", city_id: nil, name: "Sylvestre, 
francois.b", prefix: "", other_number: nil, door_number: nil, suffix: nil>, 
"name"])

#can_view?(["Price Waterhouse Coopers"])

The 1st one is a referrer field, which is a simple belongs_to :person 
association. The 2nd one is my #addressee_name. If I change my code to show the 
addressee field itself, then the addressee field doesn't show up on my form, 
even though Event#view_permitted? returns true, always.

Thoughts on all this? How can I name-one a non-ActiveRecord model?

Thanks!
François

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to