I'm looking for some clarification regarding finds in a :has_many, :belongs_to relationship. Consider:
class User < ARB has_many :tasks end
class Task < ARB belongs_to :user end
Both of these methods in a controller yield the same result:
def find_tasks_for_user @user = User.find(params[:id]) @tasks = Task.find_all_by_user_id(params[:id]) end
def find_tasks_for_user @user = User.find(params[:id]) @tasks = @user.tasks end
I'm assuming that the latter is the more idiomatic of the two. But is there anything "wrong" with the first approach?