Hi,

That s not correct at least in my enviroment: Rails 2.3.3
And due to the fact that I ve seen similar issues in the web I do not
think that it s just my system.

if you add the require statement in the header of
application_controller, it seems that the autoloading feature of
activesupport is not working as expected, because the whole
activescaffold files are not autoloaded.

In case you add the require statement at bottom of
application_controller (application_controller includes a set_default
activescaffold block) it works.

Ive created traces with dependencies logging on, will upload them in
parallel.

Would be interesting to see if it is reproduceable on other systems.

Just create a file with the following code and require it:
require 'logger'

RAILS_DEFAULT_LOGGER.info("Im loading my extension")

ActiveScaffold::DataStructures::ActionColumns.class_eval do
  def my_test
    "my_test"
  end
end

--
Volker


On 4 Aug., 13:07, "Sergio Cambra .:: entreCables S.L. ::."
<[email protected]> wrote:
> On Martes, 4 de Agosto de 2009 11:23:41 [email protected] escribió:
>
> > Hi,
>
> > Where do you recommend to require that file??
>
> > Requiring in an initializer all your examples as well as mine are
> > failing because the active_scaffold classes are not yet loaded.
>
> > Requiring directly after set_defaults block in application_controller
> > is working, but I do not like it.
>
> > --
> > Volker
>
> You can add at bottom of environment.rb, at top of application_controller
> should work too.
>
>
>
>
>
> > On 3 Aug., 10:50, "Sergio Cambra .:: entreCables S.L. ::."
>
> > <[email protected]> wrote:
> > > On Viernes, 31 de Julio de 2009 17:03:20 Nick Rogers escribió:
> > > > try...
>
> > > > ActiveScaffold::DataStructures::ActionColumns.class_eval do
> > > >   def test
> > > >   end
> > > > end
>
> > > This is the right way, although usually is recommended to use a module
> > > and include it:
> > > module ActionColumnsExtension
> > >   def test
> > >   end
> > > end
>
> > > ActiveScaffold::DataStructures::ActionColumns.class_eval do
> > >   include ActionColumnsExtension
> > > endhttp://blog.jayfields.com/2008/07/ruby-underuse-of-modules.html
>
> > > > On Fri, Jul 31, 2009 at 7:09 AM, Kenny Ortmann
>
> > > <[email protected]>wrote:
> > > > > I do not know the answer to your question, but what are you trying to
> > > > > add?
>
> > > > > On Fri, Jul 31, 2009 at 9:04 AM, [email protected] <
>
> > > > > [email protected]> wrote:
> > > > >> Hi,
>
> > > > >> I ve got quite a basic question.
>
> > > > >> Let s assume I would like to add a new method to an activescaffold
> > > > >> class eg action_columns.rb
> > > > >> I m trying to avoid changing the file itself...
>
> > > > >> How should I do that?
>
> > > > >> Ive tried to do it via an extension file, which is required in
> > > > >> application_controller:
> > > > >> module ActiveScaffold::DataStructures
> > > > >>  class ActionColumns
> > > > >>    def test
> > > > >>    end
> > > > >>  end
> > > > >> end
>
> > > > >> However, that has the negative effect, that AS File never gets
> > > > >> loaded, which is bad...
>
> > > > >> Thanks a lot in advance..
> > > > >> Volker
>
> > > --
> > > Sergio Cambra .:: entreCables S.L. ::.
> > > Mariana Pineda 23, 50.018 Zaragoza
> > > T) 902 021 404 F) 976 52 98 07 E) [email protected]
>
> --
> Sergio Cambra .:: entreCables S.L. ::.
> Mariana Pineda 23, 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