Displaying 1 result from an estimated 1 matches for "find_users_and_notes_from_date".
2006 Sep 28
5
Eager loading using find_by_sql
...round this by eager loading Wherenotes with each
user, but this causes a separate problem, as, over time, each user has
built up quite a stack of Wherenotes and eager loading them all takes up
too much time and memory.
Inside my team model I have written the following function.
<code>
def find_users_and_notes_from_date(date)
sql = ""
sql += "SELECT distinct u.*, w.* "
sql += "FROM whereusers u, wherenotes w, teams t, teams_users tu "
sql += "WHERE u.id = tu.user_id "
sql += "AND w.user_id = u.id "
sql += "AND w.note_date = " + date.strftime(&...