Remove deprecations printed out in the test suite

This commit is contained in:
Matt Rogers 2018-11-20 19:57:02 -06:00
parent d3c9975606
commit f2647e3f94
No known key found for this signature in database
GPG key ID: 605D017C07EB4316
5 changed files with 10 additions and 10 deletions

View file

@ -39,8 +39,8 @@ class ContextsController < ApplicationController
unless @context.nil? unless @context.nil?
@max_completed = current_user.prefs.show_number_completed @max_completed = current_user.prefs.show_number_completed
@done = @context.todos.completed.limit(@max_completed).reorder("todos.completed_at DESC, todos.created_at DESC").includes(Todo::DEFAULT_INCLUDES) @done = @context.todos.completed.limit(@max_completed).reorder(Arel.sql("todos.completed_at DESC, todos.created_at DESC")).includes(Todo::DEFAULT_INCLUDES)
@not_done_todos = @context.todos.active_or_hidden.not_project_hidden.reorder('todos.due IS NULL, todos.due ASC, todos.created_at ASC').includes(Todo::DEFAULT_INCLUDES) @not_done_todos = @context.todos.active_or_hidden.not_project_hidden.reorder(Arel.sql('todos.due IS NULL, todos.due ASC, todos.created_at ASC')).includes(Todo::DEFAULT_INCLUDES)
@todos_without_project = @not_done_todos.select{|t| t.project.nil?} @todos_without_project = @not_done_todos.select{|t| t.project.nil?}
@deferred_todos = @context.todos.deferred.includes(Todo::DEFAULT_INCLUDES) @deferred_todos = @context.todos.deferred.includes(Todo::DEFAULT_INCLUDES)

View file

@ -629,19 +629,19 @@ class TodosController < ApplicationController
@not_done_todos = todos_with_tag_ids. @not_done_todos = todos_with_tag_ids.
active.not_hidden. active.not_hidden.
reorder('todos.due IS NULL, todos.due ASC, todos.created_at ASC'). reorder(Arel.sql('todos.due IS NULL, todos.due ASC, todos.created_at ASC')).
includes(Todo::DEFAULT_INCLUDES) includes(Todo::DEFAULT_INCLUDES)
@hidden_todos = todos_with_tag_ids. @hidden_todos = todos_with_tag_ids.
hidden. hidden.
reorder('todos.completed_at DESC, todos.created_at DESC'). reorder(Arel.sql('todos.completed_at DESC, todos.created_at DESC')).
includes(Todo::DEFAULT_INCLUDES) includes(Todo::DEFAULT_INCLUDES)
@deferred_todos = todos_with_tag_ids. @deferred_todos = todos_with_tag_ids.
deferred. deferred.
reorder('todos.show_from ASC, todos.created_at DESC'). reorder(Arel.sql('todos.show_from ASC, todos.created_at DESC')).
includes(Todo::DEFAULT_INCLUDES) includes(Todo::DEFAULT_INCLUDES)
@pending_todos = todos_with_tag_ids. @pending_todos = todos_with_tag_ids.
blocked. blocked.
reorder('todos.show_from ASC, todos.created_at DESC'). reorder(Arel.sql('todos.show_from ASC, todos.created_at DESC')).
includes(Todo::DEFAULT_INCLUDES) includes(Todo::DEFAULT_INCLUDES)
@todos_without_project = @not_done_todos.select{|t| t.project.nil?} @todos_without_project = @not_done_todos.select{|t| t.project.nil?}
@ -1323,7 +1323,7 @@ end
end end
not_done_todos = not_done_todos. not_done_todos = not_done_todos.
reorder("todos.due IS NULL, todos.due ASC, todos.created_at ASC"). reorder(Arel.sql("todos.due IS NULL, todos.due ASC, todos.created_at ASC")).
includes(Todo::DEFAULT_INCLUDES) includes(Todo::DEFAULT_INCLUDES)
not_done_todos = not_done_todos.limit(sanitize(params[:limit])) if params[:limit] not_done_todos = not_done_todos.limit(sanitize(params[:limit])) if params[:limit]

View file

@ -1,6 +1,6 @@
class Context < ApplicationRecord class Context < ApplicationRecord
has_many :todos, -> { order("todos.due IS NULL, todos.due ASC, todos.created_at ASC").includes(:project) }, :dependent => :delete_all has_many :todos, -> { order(Arel.sql("todos.due IS NULL, todos.due ASC, todos.created_at ASC")).includes(:project) }, :dependent => :delete_all
has_many :recurring_todos, :dependent => :delete_all has_many :recurring_todos, :dependent => :delete_all
belongs_to :user belongs_to :user

View file

@ -1,5 +1,5 @@
class Project < ApplicationRecord class Project < ApplicationRecord
has_many :todos, -> {order("todos.due IS NULL, todos.due ASC, todos.created_at ASC")}, dependent: :delete_all has_many :todos, -> {order(Arel.sql("todos.due IS NULL, todos.due ASC, todos.created_at ASC"))}, dependent: :delete_all
has_many :notes, -> {order "created_at DESC"}, dependent: :delete_all has_many :notes, -> {order "created_at DESC"}, dependent: :delete_all
has_many :recurring_todos has_many :recurring_todos

View file

@ -29,7 +29,7 @@ module Search
@user.todos. @user.todos.
where("(todos.description LIKE ? OR todos.notes LIKE ?) AND todos.completed_at IS NULL", terms, terms). where("(todos.description LIKE ? OR todos.notes LIKE ?) AND todos.completed_at IS NULL", terms, terms).
includes(Todo::DEFAULT_INCLUDES). includes(Todo::DEFAULT_INCLUDES).
reorder("todos.due IS NULL, todos.due ASC, todos.created_at ASC") reorder(Arel.sql("todos.due IS NULL, todos.due ASC, todos.created_at ASC"))
end end
def complete_todos(terms) def complete_todos(terms)