]> git.openstreetmap.org Git - rails.git/blob - app/controllers/api/nodes/ways_controller.rb
Adds storing note's properties to notes
[rails.git] / app / controllers / api / nodes / ways_controller.rb
1 module Api
2   module Nodes
3     class WaysController < ApiController
4       authorize_resource
5
6       before_action :set_request_formats
7
8       ##
9       # returns all the ways which are currently using the node given in the
10       # :node_id parameter. note that this used to return deleted ways as well, but
11       # this seemed not to be the expected behaviour, so it was removed.
12       def index
13         @ways = Way
14                 .visible
15                 .where(:id => WayNode.where(
16                   :node_id => params[:node_id]
17                 ).select(:way_id))
18
19         # Render the result
20         respond_to do |format|
21           format.xml
22           format.json
23         end
24       end
25     end
26   end
27 end