First let me show some code.
class User
has_and_belongs_to_many :roles
named_scope :employees, { :conditions => ["roles.name = 'Employee'"], :include => :roles }
end
OK, so later in a controller I wanted to search for all the employees right. I set the named scope up to help do that with the join and conditional search. But the problem is in the view I want to show all of that users roles, but It will only display the employee role.
Is there anyway that I can say "user.roles" and have the be lazy loaded in the view after I have already eager loaded it?