API docs and default radius changes plus merging of feature_lock on FE
parent
87e79310a7
commit
17317e2465
|
@ -1,15 +1,15 @@
|
|||
<% if (response.success? || note.present?) %>
|
||||
# <%= response.success? ? "" : "(NOT OK)" %> <%= request.method %> <%= request.path.first(45) %>
|
||||
# <%= response.success? ? "" : "(NOT OK)" %> <%= request.pretty_url %>
|
||||
<% if note.present? %>
|
||||
**Notes:** <%= note %>
|
||||
<% end %>
|
||||
<% if request.params.except(:controller, :action, :format, :id).keys.length > 0 %>
|
||||
<% if request.has_params? %>
|
||||
|
||||
### Request
|
||||
|
||||
```
|
||||
<%=
|
||||
JSON.pretty_generate(request.params.except(:controller, :action, :format, :id, :user_id, :device_id))
|
||||
request.display_body
|
||||
%>
|
||||
```
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class ChangeDefaultRadius < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
change_column :points, :radius, :float, default: 25
|
||||
end
|
||||
end
|
|
@ -37,7 +37,7 @@ RSpec.configure do |config|
|
|||
|
||||
if ENV['DOCS']
|
||||
config.after(:each, type: :controller) do
|
||||
SmarfDoc.run!(request, response)
|
||||
SmarfDoc.run!(NiceResponse.new(request), response)
|
||||
end
|
||||
|
||||
config.after(:suite) do
|
||||
|
@ -52,3 +52,30 @@ def const_reassign(target, const, value)
|
|||
target.send(:remove_const, const)
|
||||
target.const_set(const, value)
|
||||
end
|
||||
|
||||
class NiceResponse
|
||||
attr_reader :r
|
||||
|
||||
def initialize(r)
|
||||
@r = r
|
||||
end
|
||||
|
||||
def path
|
||||
r.path
|
||||
end
|
||||
|
||||
def pretty_url
|
||||
r.method + " " + r.path.first(45)
|
||||
end
|
||||
|
||||
def has_params?
|
||||
r.params.except(:controller, :action, :format, :id).keys.length > 0
|
||||
end
|
||||
|
||||
def display_body
|
||||
p = r
|
||||
.params
|
||||
.except(:controller, :action, :format, :id, :user_id, :device_id)
|
||||
JSON.pretty_generate(p)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue