views:

58

answers:

1

If I have 2 different classes with name User, say one in FooModule and other as a model in app/models/user.rb, how do I make sure I am using the correct one?

EDIT: FooModule::User would definitely give me the correct one.

What I had meant to ask was: If ApplicationController includes FooModule, would User or ::User still give me app/models/user?

+4  A: 

Refer to them using their full names, FooModule::User and ::User

Generally if you just use User, it should assume you mean ::User, unless you are within FooModule. Either way, use FooModule::User or ::User to be sure.

Steven Soroka