make tokens description field optional
This commit is contained in:
parent
8ac8aad105
commit
8afef1bc4a
1 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,19 @@ module Api
|
|||
[:description]
|
||||
end
|
||||
|
||||
def create
|
||||
if params[:token].blank?
|
||||
self.resource = resource_class.new
|
||||
else
|
||||
instantiate_resource
|
||||
end
|
||||
|
||||
resource.user = current_user if current_user.present?
|
||||
authorize resource
|
||||
create_action
|
||||
respond_with_resource
|
||||
end
|
||||
|
||||
def my_tokens
|
||||
authorize resource_class
|
||||
instantiate_collection
|
||||
|
|
Loading…
Reference in a new issue