Reputation: 1648
I have code like this.
class User < ActiveRecord::Base
end
module Foo
class User
end
end
module Foo
class DoesSomethingWithActiveRecordUser
def initialize user_id
User.find(user_id)
end
end
end
If I call Foo::DoesSomethingWithActiveRecordUser.new(1)
I get an error message that says something like undefined method 'find' for Foo::User
.
How do I call the ActiveRecord User from within Foo
?
Thanks.
Upvotes: 9
Views: 3955