Permalink
Browse files

Change render_json to json_response.

Render is loaded thanks to rails so I'm going to avoid it.
  • Loading branch information...
1 parent ae9173c commit 3f9d775c8426a0ba77d1c1d1da11bee10093a50d @jnunemaker committed Feb 12, 2013
Showing with 7 additions and 7 deletions.
  1. +1 −1 lib/flipper/ui/action.rb
  2. +1 −1 lib/flipper/ui/actions/features.rb
  3. +5 −5 lib/flipper/ui/actions/gate.rb
@@ -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)
@@ -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
@@ -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

0 comments on commit 3f9d775

Please sign in to comment.