RC Init Question

3 views
Skip to first unread message

Meech

unread,
Mar 26, 2009, 5:22:53 PM3/26/09
to resource_controller
Using the latest plugin.

I have some AR::Base class/instance extensions that I use and put into
a lib/module.

When RC is installed, it seems to load up all the models. This
happens before lib modules are loaded, which prevents the server from
starting with method_not_found errors for my custom class methods.

Everything works fine without RC.

I know I could probably roll my extensions into a plugin, but that
seems like more work/overhead than is required. A lot of these
extenstions are application specific.

James Golick

unread,
Mar 26, 2009, 5:27:53 PM3/26/09
to resource_...@googlegroups.com
Are you sure you're using the latest gem from github?
Message has been deleted

Meech

unread,
Mar 26, 2009, 5:38:32 PM3/26/09
to resource_controller
using the plugin. I'll try the gem.

Meech

unread,
Mar 26, 2009, 5:42:08 PM3/26/09
to resource_controller
Same thing with the gem.


config.gem 'giraffesoft-resource_controller' in my environment,
server startup fails at the first custom AR method.

Without it, everything runs fine.

James Golick

unread,
Mar 26, 2009, 5:43:57 PM3/26/09
to resource_...@googlegroups.com
Well, r_c doesn't preload any models at all. The only thing that it does do is require_dependency 'application_controller'.

Why don't you try putting the monkey patch in to an initializer?

Meech

unread,
Mar 26, 2009, 5:48:56 PM3/26/09
to resource_controller
Same thing with the latest (0.5.6) gem.

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:1964:in `method_missing': undefined method `secure_column' for
#<Class:0xb6f5e018> (NoMethodError)


secure_column is a custom class method of mine.

James Golick

unread,
Mar 26, 2009, 5:51:00 PM3/26/09
to resource_...@googlegroups.com
Can I see soe more backtrace?

Meech

unread,
Mar 26, 2009, 5:51:16 PM3/26/09
to resource_controller
Sweet, you just kicked me in the right direction.

requiring application_controller inits acts_as_audited which in turn
causes the problem.

I'll move the act_as_audited defs to the model (which is where they
probably belong anyhow).



Thanks

Meech

unread,
Mar 26, 2009, 5:59:02 PM3/26/09
to resource_controller
FYI, there is some directory looping going on in the plugin. Here
is a sample path from a freshly cloned repo. Doesn't stop it from
working, but under certain conditions (deleting the plugin) netbeans
wigs out.


/resource_controller/test/vendor/gems/resource_controller-10.0.0/test/
vendor/gems/resource_controller-10.0.0/test/vendor/gems/
resource_controller-10.0.0/test/vendor/gems/resource_controller-10.0.0/
test/vendor/gems/resource_controller-10.0.0/test/vendor/gems/
resource_controller-10.0.0/test/vendor/gems/resource_controller-10.0.0/
test/vendor/gems/resource_controller-10.0.0/test/vendor/gems/
resource_controller-10.0.0/test/vendor/gems/resource_controller-10.0.0/
test/vendor/gems/resource_controller-10.0.0/test/vendor/gems/
resource_controller-10.0.0/test/vendor/gems/resource_controller-10.0.0/
test/vendor/gems/resource_controller-10.0.0/test/vendor/gems/
resource_controller-10.0.0

James Golick

unread,
Mar 26, 2009, 6:00:49 PM3/26/09
to resource_...@googlegroups.com
It's a recursive symlink. Competent software can handle it fine :-)

Meech

unread,
Mar 26, 2009, 6:13:51 PM3/26/09
to resource_controller
Snap. Gotcha. :P

Ignore me, I'm a crusty old RPG guy....

I also use declarative_authorization plugin. Which allows a

filter_access_to :all

type declaration in the app controller. Now this is blowing up.

Looks like I'll have to mess with the plugin ordering.

thanks for the quick responses!
Reply all
Reply to author
Forward
0 new messages