issue_query.rb.patch

Pavel Rosick√Ĺ, 2019-03-06 13:51

Download (844 Bytes)

View differences:

issue_query.rb (working copy)
379 379
    neg = (operator == '!' ? 'NOT' : '')
380 380
    subquery = "SELECT 1 FROM #{Journal.table_name} sj" +
381 381
      " WHERE sj.journalized_type='Issue' AND sj.journalized_id=#{Issue.table_name}.id AND (#{sql_for_field field, '=', value, 'sj', 'user_id'})" +
382
      " AND sj.id = (SELECT MAX(#{Journal.table_name}.id) FROM #{Journal.table_name}" +
382
      " AND sj.id IN (SELECT MAX(#{Journal.table_name}.id) FROM #{Journal.table_name}" +
383 383
      "   WHERE #{Journal.table_name}.journalized_type='Issue' AND #{Journal.table_name}.journalized_id=#{Issue.table_name}.id" +
384 384
      "   AND (#{Journal.visible_notes_condition(User.current, :skip_pre_condition => true)}))"
385 385