Strange error when reloading page

2 views
Skip to first unread message

maui

unread,
May 10, 2007, 7:15:42 PM5/10/07
to MOle Plugin
Hi all,

I'm using Rail 1.1.6 on FreeBSD with ruby 1.8.5. I've setup
environment.rb as suggested in the README and added the load line to
the top of my ApplicationController definition. When I hit the action
for which I defined an "after" it works the first time through.
However, when I refresh the page in my browser the mole_logs table
isn't added to and the following ends up in the log:

>>> Mole Error: After-Filter -- uninitialized constant MoleFeature
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/
active_support/dependencies.
rb:123:in `const_missing'
/usr/home/maui/dve/ideeli_trunk/config/../vendor/plugins/mole/lib/mole/
db_mole.rb:23:i
n `mole_it'
/usr/home/maui/dve/ideeli_trunk/config/../config/mole.conf:19

I'm thinking perhaps I put the load line in the wrong place. Should
it be inside the ApplicationController definition?

Thanks,

Mark

Fernand Galiana

unread,
May 10, 2007, 10:58:23 PM5/10/07
to mole-...@googlegroups.com
Hi Mark,

  Hum...Assuming you are running in development ?
  It looks like somehow the mole model classes are not being reloaded...
 
  I would not think the load method would matter, being inside or outside the
  application class body. Try adding a require 'mole' in the db_mole class and see
  if this helps at all..

  Please keep us posted...

-Fernand

digidigo

unread,
Jun 8, 2007, 1:59:23 PM6/8/07
to MOle Plugin
I am having the same issue. Just moled my app, and have

class ApplicationController < ActionController::Base
include CachingHelper
include ControllerUtil

before_filter :setup_current_user,:authenticate

load MOLE.path if File.exists?(MOLE.path) and MOLEABLE_APP

end


works great on first request and fails on a refresh. I added require
'mole'
To the db_mole and this had no effect.

Any progess? Thoughts?

Thanks,

Dave

On May 10, 8:58 pm, "Fernand Galiana" <fernand.gali...@gmail.com>
wrote:

digidigo

unread,
Jun 8, 2007, 2:33:49 PM6/8/07
to MOle Plugin
Found it.

add this to init.rb uner the mole plugin dir.

$: << File.join(File.dirname(__FILE__), 'lib','models')


I think rails is unloading all the models int dev mode. And then it
can't find the mole models. My guess is that this is something that
engines does for you.

Dave

Fernand Galiana

unread,
Jun 8, 2007, 4:38:04 PM6/8/07
to mole-...@googlegroups.com
Thanks David, for hunting this down. Somehow I haven't got this error with rails1.2.

-Fernand
Reply all
Reply to author
Forward
0 new messages