-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add Authorization endpoints to API which lists accounts. #101
Conversation
end | ||
|
||
included do | ||
extend ActiveModel::Naming unless (method(:model_name) rescue 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.
Avoid using rescue
in its modifier form.
|
||
class Api::AuthorizationsController < Api::BaseController | ||
def resource | ||
Authorization.new(User.find(prx_auth_token.user_id)) |
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 might DRY this out a bit and put User.find(prx_auth_token.user_id)
into a find or get user method.
@chrisrhoden I had only minor feedback on this, LGTM. |
# consider if there is a better way to do this - decorate model instead? | ||
attr_accessor :is_root_resource | ||
|
||
def is_root_resource |
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.
Rename is_root_resource
to root_resource?
.
# encoding: utf-8 | ||
|
||
class Api::AuthorizationsController < Api::BaseController | ||
private |
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.
Keep a blank line before and after private
.
@kookster let me know if I missed something |
Add Authorization endpoints to API which lists accounts.
resolves #99