snipt

Ctrl+h for KB shortcuts

Text only

scope rails

includes(:class_room).where('class_rooms.course_id=? AND class_rooms.teacher_id=? AND student_histories.date = ? ',idcourse, idteacher, ClassRoom.where(course_id: idcourse).maximum(:last_cooking_date)).references(:class_room).order('student_histories.date ASC')
https://snipt.net/embed/3a8d7478c0cdd74209697c65c30d689a/
/raw/3a8d7478c0cdd74209697c65c30d689a/
3a8d7478c0cdd74209697c65c30d689a
text
Text only
1
2019-08-25T14:45:25
True
False
False
/api/public/snipt/143678/
scope-rails
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>includes(:class_room).where(&#39;class_rooms.course_id=? AND class_rooms.teacher_id=? AND student_histories.date = ? &#39;,idcourse, idteacher, ClassRoom.where(course_id: idcourse).maximum(:last_cooking_date)).references(:class_room).order(&#39;student_histories.date ASC&#39;) </span></pre></div> </td></tr></table>
model, rails, scope