From: ENT8R Date: Fri, 25 Aug 2023 22:31:18 +0000 (+0200) Subject: Use where instead of find to prevent 404 X-Git-Tag: live~1201^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b9c85c269726faad3c2613b37f01683c8b59f5c6?ds=inline Use where instead of find to prevent 404 --- diff --git a/app/controllers/api/users_controller.rb b/app/controllers/api/users_controller.rb index 9da9d3226..a921b6db7 100644 --- a/app/controllers/api/users_controller.rb +++ b/app/controllers/api/users_controller.rb @@ -19,7 +19,7 @@ module Api raise OSM::APIBadUserInput, "No users were given to search for" if ids.empty? - @users = User.visible.find(ids) + @users = User.visible.where(:id => ids) # Render the result respond_to do |format| diff --git a/app/views/api/users/index.xml.builder b/app/views/api/users/index.xml.builder index 60fcfa898..1b284ef5e 100644 --- a/app/views/api/users/index.xml.builder +++ b/app/views/api/users/index.xml.builder @@ -1,4 +1,4 @@ xml.instruct! :xml, :version => "1.0" xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << render(@users) + osm << (render(@users) || "") end