On Miércoles, 27 de Mayo de 2009 12:42:09 Ed W escribió:
> Hi
>
> > You should modify active_scaffold_frontends or
> > active_scaffold_overrides, never active_scaffold_paths. Plugins should
> > add their view paths at the end of active_scaffold_overrides or at the
> > beginning of active_scaffold_frontends, so users can override plugin's
> > views, and plugin can override ActiveScaffold's views.
>
> There is an initialisation race here though because if anything touches
> the "active_scaffold_paths" function then the result becomes memoised
> and unchangeable.  This is my only critique of the current situation
>
> Adding some kinds of setters/getters would at least allow to scope to
> burst this memoisation if anything changes
>
> Also it just feels a bit dirty to set module level variables from
> outside of the enclosing code...
>
> > Maybe it would be better to add a method add_active_scaffold_path
> > which add a view path between active_scaffold_overrides and
> > active_scaffold_frontends.
>
> I misread your suggestion on the other thread.  I guess if the plugin
> always overrides the main AS views then this covers 99% of situations
> because the plugin is free to choose sensible names to avoid breaking
> AS, but can still override AS if it's necessary.
>
> Yes, lets go with that solution then.  Can I recommend that we have both
> a getter and a setter so we can do introspection and also that the
> setter burst the memoised value for the full pathlist so that we don't
> get any bugs due to initalisation ordering?

We have now active_scaffold_paths (getter) and add_active_scaffold_path (burst 
the memoized value and add a new path). 

-- 
Sergio Cambra .:: entreCables 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to