mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-07 08:21:47 +01:00
fix failing tests
This commit is contained in:
parent
20b4b626fe
commit
2daffef683
4 changed files with 28 additions and 21 deletions
|
|
@ -23,7 +23,7 @@ module Todos
|
|||
def filter_attributes(params)
|
||||
if params[:request]
|
||||
@attributes = todo_params(params[:request])
|
||||
else
|
||||
elsif params[:todo]
|
||||
@attributes = todo_params(params)
|
||||
end
|
||||
@attributes = {} if @attributes.nil? # make sure there is at least an empty hash
|
||||
|
|
@ -123,7 +123,14 @@ module Todos
|
|||
def todo_params(params)
|
||||
# keep :predecessor_dependencies from being filterd (for XML API).
|
||||
# The permit cannot handle multiple precessors
|
||||
deps = params[:todo][:predecessor_dependencies][:predecessor] if params[:todo][:predecessor_dependencies]
|
||||
if params[:todo][:predecessor_dependencies]
|
||||
deps = params[:todo][:predecessor_dependencies][:predecessor]
|
||||
end
|
||||
|
||||
# accept empty :todo hash
|
||||
if params[:todo].empty?
|
||||
params[:todo] = {:ignore => true}
|
||||
end
|
||||
|
||||
filtered = params.require(:todo).permit(
|
||||
:context_id, :project_id, :description, :notes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue