I am new in RoR 3 and I am experiencing a problem.
I have a class User
like this
class User < ActiveRecord::Base
attr_accessible :firstname, :lastname, :login, :password, :rank, :sa_id,
belongs_to :role
belongs_to :company
end
When in my controller I get first user (for example) User.first
I can access to User.first.role
Is it possible to fetch all users including the belongs_to objects ? Like the result would be all the users and in each user an object of type role and an object of type company?
Thanks