i'm upgrading rails 3.2.12 4.2.0
most things working now, 1 query problem. don't know how transform 4.2.0
user_lesson = self.user_lessons.find :first, :include => [:lesson], :conditions => ["worked = ? , passed = ?", true, false], :order => "lessons.sort"
i have second 1 problems
memberships = membership.find :all, :include => [:course], :conditions => ["next_mindmail < ? , course_objects.active = ?", datetime.now.utc, true]
i tried this:
memberships = membership.joins(:course).where("next_mindmail < ? , active = ?", datetime.now.utc, true).all
but seems not same...
self.users.includes(:lesson).where("worked = ? , passed = ?, true, fale).order('lessons.sort').first
all rails query interfaces here
Comments
Post a Comment