Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change render_json to json_response.

Render is loaded thanks to rails so I'm going to avoid it.
  • Loading branch information...
commit 3f9d775c8426a0ba77d1c1d1da11bee10093a50d 1 parent ae9173c
John Nunemaker authored
2  lib/flipper/ui/action.rb
View
@@ -105,7 +105,7 @@ def render(name)
Rack::Response.new(body, @code, @headers)
end
- def render_json(object, options = {})
+ def json_response(object, options = {})
body = MultiJson.dump(object)
code = options.fetch(:code, @code)
2  lib/flipper/ui/actions/features.rb
View
@@ -13,7 +13,7 @@ def get
Decorators::Feature.new(feature)
}
- render_json features.map(&:as_json)
+ json_response features.map(&:as_json)
end
end
end
10 lib/flipper/ui/actions/gate.rb
View
@@ -33,7 +33,7 @@ def post
send(update_gate_method_name, feature)
gate = feature.gate(gate_name)
- render_json Decorators::Gate.new(gate).as_json
+ json_response Decorators::Gate.new(gate).as_json
end
def update_boolean(feature)
@@ -107,7 +107,7 @@ def invalid_actor_value(value)
code: 422,
}
- halt render_json(response, options)
+ halt json_response(response, options)
end
# Private: Returns error response for invalid percentage value.
@@ -121,7 +121,7 @@ def invalid_percentage(value, exception)
code: 422,
}
- halt render_json(response, options)
+ halt json_response(response, options)
end
# Private: Returns error response that group was not registered.
@@ -135,7 +135,7 @@ def group_not_registered(group_name)
code: 404,
}
- halt render_json(response, options)
+ halt json_response(response, options)
end
# Private: Returns error response that gate update method is not defined.
@@ -149,7 +149,7 @@ def update_gate_method_undefined(gate_name)
code: 404,
}
- halt render_json(response, options)
+ halt json_response(response, options)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.