Christoffer Reijer
Christoffer Reijer

Reputation: 1995

Default namespace of models in Rails

After upgrading my Rails app, I have run into a problem where the name of one of my models are conflicting with another class in Rails, namely Configuration.

Is there a way for me to (from a controller) explicit use my model class Configuration instead of ActiveSupport::Configurable::Configuration? What is the default namespace for my models?

Upvotes: 1

Views: 875

Answers (1)

dx7
dx7

Reputation: 812

You can use ::Configuration to call your class. It means that you're referring to the constant Configuration from the toplevel namespace. But I think it's annoying. You can rename your class to avoid this.

Upvotes: 3

Related Questions