From 3ac6b19aa1f7305199b81fa032331e4ff6a40862 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 26 Aug 2025 17:46:18 +0300 Subject: [PATCH] Use @elements instead of @elems in api element history --- app/controllers/api/old_elements_controller.rb | 6 +----- app/views/api/old_nodes/index.json.jbuilder | 2 +- app/views/api/old_nodes/index.xml.builder | 2 +- app/views/api/old_relations/index.json.jbuilder | 2 +- app/views/api/old_relations/index.xml.builder | 2 +- app/views/api/old_ways/index.json.jbuilder | 2 +- app/views/api/old_ways/index.xml.builder | 2 +- 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/old_elements_controller.rb b/app/controllers/api/old_elements_controller.rb index 8e29e245c..433eec085 100644 --- a/app/controllers/api/old_elements_controller.rb +++ b/app/controllers/api/old_elements_controller.rb @@ -19,11 +19,7 @@ module Api raise OSM::APINotFoundError if @elements.empty? # determine visible elements - @elems = if show_redactions? - @elements - else - @elements.unredacted - end + @elements = @elements.unredacted unless show_redactions? # Render the result respond_to do |format| diff --git a/app/views/api/old_nodes/index.json.jbuilder b/app/views/api/old_nodes/index.json.jbuilder index 3a800d07d..c59fad402 100644 --- a/app/views/api/old_nodes/index.json.jbuilder +++ b/app/views/api/old_nodes/index.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" json.elements do - json.array! @elems, :partial => "old_node", :as => :old_node + json.array! @elements, :partial => "old_node", :as => :old_node end diff --git a/app/views/api/old_nodes/index.xml.builder b/app/views/api/old_nodes/index.xml.builder index 905381ce9..433f93349 100644 --- a/app/views/api/old_nodes/index.xml.builder +++ b/app/views/api/old_nodes/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(@elems) || "") + osm << (render(@elements) || "") end diff --git a/app/views/api/old_relations/index.json.jbuilder b/app/views/api/old_relations/index.json.jbuilder index 944bed023..9925943f8 100644 --- a/app/views/api/old_relations/index.json.jbuilder +++ b/app/views/api/old_relations/index.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" json.elements do - json.array! @elems, :partial => "old_relation", :as => :old_relation + json.array! @elements, :partial => "old_relation", :as => :old_relation end diff --git a/app/views/api/old_relations/index.xml.builder b/app/views/api/old_relations/index.xml.builder index 905381ce9..433f93349 100644 --- a/app/views/api/old_relations/index.xml.builder +++ b/app/views/api/old_relations/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(@elems) || "") + osm << (render(@elements) || "") end diff --git a/app/views/api/old_ways/index.json.jbuilder b/app/views/api/old_ways/index.json.jbuilder index 9e98901f5..90d96320c 100644 --- a/app/views/api/old_ways/index.json.jbuilder +++ b/app/views/api/old_ways/index.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" json.elements do - json.array! @elems, :partial => "old_way", :as => :old_way + json.array! @elements, :partial => "old_way", :as => :old_way end diff --git a/app/views/api/old_ways/index.xml.builder b/app/views/api/old_ways/index.xml.builder index 905381ce9..433f93349 100644 --- a/app/views/api/old_ways/index.xml.builder +++ b/app/views/api/old_ways/index.xml.builder @@ -1,5 +1,5 @@ xml.instruct! xml.osm(OSM::API.new.xml_root_attributes) do |osm| - osm << (render(@elems) || "") + osm << (render(@elements) || "") end -- 2.39.5