views:

27

answers:

1

I want to be able to override models and controllers of my rails 3 engine in the base app.

Inspecting $LOAD_PATH, I found engine's 'app/{models,controllers}' there, but I can't explicitly require engine's model or controller file: require 'engine_name/model_name' fails with "no such file" (tried with both namespaced(app/controllers/enginename/*) and plain engine).

So, what's the best way to extend engine's models/controllers in rails 3 without copying them to base app?

A: 

Basically, it's a load order problem. So, if I explicitly require model from engine, everything's ok, but I hope there is a better way.

vitus