ensure_not_nested must be a method in your app, I don't find it in 
activescaffold code.
You could avoid calling it when action name is index, or move out of 
new_model method and add it as before_action only in needed actions.
ActiveScaffold needs to build @record to display search form, so it you 
need search form, new_model must work.

El lunes, 3 de julio de 2017, 22:17:02 (UTC+2), Jan Hebler escribió:
>
> Hi
>
> I have an rather complex Data-Model:
>
> class Node
>   has_one :node2server
>   has_one :server, :through => node2server
>   has_many :errata, through => :server
> end
> class Node2server
>   belongs_to :node
>   belongs_to :server
> end
> class Server
>   has_one :node2server
>   has_one :node
>   has_and_belongs_to_many :errata
> end
> class Erratum
>   has_and_belongs_to_many :servers
>   has_many :node2servers
> end
>
> These are two Legacy-Applications (one CMDB and one Patchmanagement).
>
> It seems that the new_model Method is always called in the 
> _list_with_header.html.erb:
>
>     7:       <% if active_scaffold_config.list.always_show_search %>
>     8:       <% old_record, @record = @record, new_model %>
>
> which in turn calls build_record in 
> active_record/associations/has_many_through_association.rb. Build_record 
> call ensure_not_nested and this throws an 
> HasManyThroughNestedAssociationsAreReadonly-Exception. How could i avoid 
> this? I dont need writable Associations.
>
> Thanks, Jan
>

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to