Question

I have this model:

class Backend::Enterprise < ::Enterprise  

How could I call and instantiate this model in its namespace?

If I write, in backend_enterprises_controller:

@enterprise = Enterprise.find(1)

It calls to the model:

class Enterprise < ActiveRecord::Base

And I'd like to have separated methods in each namespace model.

Is it possible? I'm using Rails 3.2.14 and inherited_resources gem.

Thanks.

Was it helpful?

Solution

Maybe I misunderstand your question, but have you tried

@enterprise = Backend::Enterprise.find(1)

?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top