Hello I have no good title for this question, but my problem is to set a conditon for my sub-table in rails I have a model named "users" and another named "hours", hours is set to "belongs_to :users" and the users-model has "has_many :hours"
But my problem is when I try to fetch the users, but just the hours added this month. I want this to happen only in the Index action.
How can I set a condition for my sub table?