El Thursday 13 November 2008 13:26:37 Antonio Bardazzi Multicore-Sistemi.com 
escribió:
> Maybe I have @record controller instance variable previously defined
> for example in a before_filter so ||= is not executed.
>
> If I put logger(@record) at first line of edit_associated method I see
> the variable is already taken so I need the explicit else statement.
>
> Maybe it's only my problem :-) or is problem from AS?

You should exclude that before_filter for edit_associated in that case.

>
> many tanks
> Antonio
>
> On 12 Nov, 10:39, "Sergio Cambra .:: entreCables - Symbol Servicios
>
> Informáticos S.L. ::." <[EMAIL PROTECTED]> wrote:
> > El Tuesday 11 November 2008 10:06:04 Antonio Bardazzi
> > Multicore-Sistemi.com
> >
> > escribió:
> > > I'm testing git commit d16b4f3 (mongrel/passenger development/
> > > production)
> > >
> > > Subform instance has @record already defined and edit_associated line
> > > 9 never triggers:
> > >
> > > @record ||= @column.association.klass.new
> > >
> > > So @record.class will be always the @parent_record.class
> > >
> > > Where does @record instance come from?
> > >
> > > For now I patch with:
> > >
> > > [EMAIL PROTECTED] ||= @column.association.klass.new
> > > if params[:associated_id]
> > >   @record =
> > > @column.association.klass.find(params[:associated_id])
> > > else
> > >   @record =
> > > @column.association.klass.new
> > > end
> >
> > Sorry, but your patch does the same as code in git (lines 8 and 9):
> > @record = @column.association.klass.find(params[:associated_id]) if
> > params[:associated_id]
> > @record ||= @column.association.klass.new
> >
> > --
> > Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
> > Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
> > T) 902 021 404 F) 976 52 98 07 E) [EMAIL PROTECTED]
>
> 


-- 
Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

  • ac... Antonio Bardazzi Multicore-Sistemi.com
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... Antonio Bardazzi Multicore-Sistemi.com
    • ... venkat veerla
    • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.
      • ... venkat veerla
      • ... Antonio Bardazzi Multicore-Sistemi.com
        • ... Sergio Cambra .:: entreCables - Symbol Servicios Informáticos S.L. ::.

Reply via email to