2016-09-24 11:00:46 +08:00
|
|
|
# frozen_string_literal: true
|
2016-09-22 01:22:40 +08:00
|
|
|
module Api
|
|
|
|
module V2
|
|
|
|
class MappingsController < RestfulController
|
2016-10-04 13:51:07 +08:00
|
|
|
def searchable_columns
|
|
|
|
[]
|
|
|
|
end
|
2016-12-16 16:51:52 -05:00
|
|
|
|
|
|
|
def create
|
|
|
|
instantiate_resource
|
|
|
|
resource.user = current_user if current_user.present?
|
|
|
|
resource.updated_by = current_user if current_user.present?
|
|
|
|
authorize resource
|
|
|
|
create_action
|
|
|
|
respond_with_resource
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
|
|
|
resource.updated_by = current_user if current_user.present?
|
|
|
|
update_action
|
|
|
|
respond_with_resource
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
resource.updated_by = current_user if current_user.present?
|
|
|
|
destroy_action
|
|
|
|
head :no_content
|
|
|
|
end
|
2016-09-22 01:22:40 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|