metamaps--metamaps/app/controllers/api/v2/tokens_controller.rb

24 lines
484 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
module Api
module V2
class TokensController < RestfulController
def searchable_columns
[:description]
end
2016-10-04 08:02:58 +00:00
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
end
end
end