New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Service - ApiDocs relationship] Adapt Liquid Drops to it #71
Conversation
8641c88
to
0d9e534
Compare
0d9e534
to
032ea46
Compare
032ea46
to
a78f4f8
Compare
a78f4f8
to
ea02152
Compare
|
||
desc 'Returns the service of the spec if it has any or nil otherwise.' | ||
def service | ||
return nil unless (service = @spec.service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know if in this case I should return nil
or an empty service drop, but I saw that for other cases we are currently returning nil
so I kept it the same way. For example in:
porta/lib/developer_portal/lib/liquid/drops/service_contract.rb
Lines 29 to 33 in 029cba3
def service | |
if s = find_service | |
Drops::Service.new(s) | |
end | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's nil
then it can be less verbose
return unless service = @spec.service
ea02152
to
2fbfdd9
Compare
2fbfdd9
to
f14f5b6
Compare
f14f5b6
to
e9e6086
Compare
doc/liquid/drops.md
Outdated
@@ -362,6 +362,9 @@ Returns the url of the API spec. | |||
### system_name | |||
Returns the name of the spec. | |||
|
|||
### service | |||
Returns the service of the spec if it has any or nil otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we backquote nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea 😱 This is autogenerated, but I will try to accomplish that 😄 Maybe it is as easy as typing backquoted the original text 😊 I will try 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were right, it was that easy and it looks better 👍 💪
Depends on #62 in which ActiveDocs and Service have a relationship.
fixes https://github.com/3scale/porta/issues/61 and belongs to THREESCALE-1340
http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#service-drop
http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#apispec-drop
http://provider-admin.example.com.lvh.me:3000/p/admin/liquid_docs#provider-drop
Removing the access to deleted api_specs from provider for the service is already done in [Service - ApiDocs relationship] Create relationship and adapt endpoints for Create and Update (UI & API) #62