Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json"

We had a discussion on the Core team and we don't want to expose this information
as a JSON endpoint and not by default.

It doesn't make sense to expose this JSON locally and this controller is only
accessible in dev, so the proposed access from a production app seems off.

This reverts commit 8eaffe7e89719ac62ff29c2e4208cfbeb1cd1c38, reversing
changes made to 133e0ba33db5887b047c9ac8233e5b414657bca5.
This commit is contained in:
Kasper Timm Hansen 2019-01-08 22:21:20 +01:00
parent 647d7e6167
commit 80c7038bbc
No known key found for this signature in database
GPG Key ID: 191153215EDA53D8
5 changed files with 2 additions and 37 deletions

@ -71,12 +71,6 @@
*Gannon McGibbon*
* Add JSON support to rails properties route (`/rails/info/properties`).
Now, `Rails::Info` properties may be accessed in JSON format at `/rails/info/properties.json`.
*Yoshiyuki Hirano*
* Use Ids instead of memory addresses when displaying references in scaffold views.
Fixes #29200.

@ -54,10 +54,6 @@ def to_html
table << "</table>"
end
end
def to_json
Hash[properties].to_json
end
end
# The Rails version.

@ -14,16 +14,8 @@ def index
end
def properties
respond_to do |format|
format.html do
@info = Rails::Info.to_html
@page_title = "Properties"
end
format.json do
render json: Rails::Info.to_json
end
end
@info = Rails::Info.to_html
@page_title = "Properties"
end
def routes

@ -50,11 +50,6 @@ def setup
assert_select "table"
end
test "info controller renders json with properties" do
get :properties, format: :json
assert_equal Rails::Info.to_json, response.body
end
test "info controller renders with routes" do
get :routes
assert_response :success

@ -43,18 +43,6 @@ def test_html_includes_middleware
end
end
def test_json_includes_middleware
Rails::Info.module_eval do
property "Middleware", ["Rack::Lock", "Rack::Static"]
end
hash = JSON.parse(Rails::Info.to_json)
assert_includes hash.keys, "Middleware"
properties.value_for("Middleware").each do |value|
assert_includes hash["Middleware"], value
end
end
private
def properties
Rails::Info.properties