Hi, I've an app where there is a logical nesting of models. Think of
something like a web page:

organisation has_many websites has_many web_pages has_many :sections

The other end of each has_many is a "belongs_to".

When I put :accessible => true, :dependent => :destroy on the models
in this chain, trying to create an organisation fails. The server
crashes with messages like:

Rendered controller: organisations; dryml-tag: index-page (341.0ms)
Completed 200 OK in 1078ms (Views: 1061.0ms | ActiveRecord: 12.5ms)
Illegal instruction: 4

If I remove, all down the tree, ":accessible => true" in each
has_many, then I can create an organisation. If I leave the lower
levels with ":accessible => true", but remove it in the
"has_many :websites" association, then I can create an organisation.
If I keep the "accessible => true" in the organisation model, and
remove it in the website model for the pages association, then I can
again create an organisation:

organisation has_many !(accessible) websites has_many (accessible)
pages => OK
organisation has_many (accessible) websites has_many !(accessible)
pages => OK
organisation has_many (accessible) websites has_many (accessible)
pages => FAIL

How can I allow nested models to work on the next layer down, and
avoid this crash? I'm assuming that nesting models like this is
allowed in Hobo. I can't currently think how I'd organise my data if
I'm only allowed one level of nesting!

Should I be using "has_many :through" and ":accessible => true"? Does
that make deeply nested models work in Hobo?

I have an example app showing the failure mode that I can share on
GitHub if needed. Environment is rvm 1.10.1, Ruby 1.9.2p290, Rails
3.0.11, Hobo 1.3 on Mac OS 10.7.2

Apologies for yet another newbie distressed question. I am trying to
learn, honest!

-- 
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