Displaying 1 result from an estimated 1 matches for "whereusers".
Did you mean:
shareusers
2006 Sep 28
5
Eager loading using find_by_sql
...lt 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(''\''%d-%b-%y\'''') + " "
sql += "AND tu.team_id = "...