Prefer keyword arguments when method has optional boolean arguments

This commit is contained in:
Tom Hughes 2020-11-13 10:14:10 +00:00
parent 63221710a4
commit 582402ba8f
17 changed files with 91 additions and 101 deletions

View file

@ -21,7 +21,7 @@ module Api
def create
assert_method :put
cs = Changeset.from_xml(request.raw_post, true)
cs = Changeset.from_xml(request.raw_post, :create => true)
# Assume that Changeset.from_xml has thrown an exception if there is an error parsing the xml
cs.user = current_user

View file

@ -19,7 +19,7 @@ module Api
def create
assert_method :put
node = Node.from_xml(request.raw_post, true)
node = Node.from_xml(request.raw_post, :create => true)
# Assume that Node.from_xml has thrown an exception if there is an error parsing the xml
node.create_with_history current_user

View file

@ -16,7 +16,7 @@ module Api
def create
assert_method :put
relation = Relation.from_xml(request.raw_post, true)
relation = Relation.from_xml(request.raw_post, :create => true)
# Assume that Relation.from_xml has thrown an exception if there is an error parsing the xml
relation.create_with_history current_user

View file

@ -98,7 +98,7 @@ module Api
end
end
trkseg << point.to_xml_node(timestamps)
trkseg << point.to_xml_node(:print_timestamp => timestamps)
end
response.headers["Content-Disposition"] = "attachment; filename=\"tracks.gpx\""

View file

@ -16,7 +16,7 @@ module Api
def create
assert_method :put
way = Way.from_xml(request.raw_post, true)
way = Way.from_xml(request.raw_post, :create => true)
# Assume that Way.from_xml has thrown an exception if there is an error parsing the xml
way.create_with_history current_user