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

26 lines
827 B
Ruby
Raw Normal View History

2016-09-24 03:00:46 +00:00
# frozen_string_literal: true
module Api
module V2
class MappingsController < RestfulController
def searchable_columns
[]
end
2016-12-14 15:08:59 +00:00
def update
# mappings are the only things where the user is set to the latest updater
# done this way so that the model hooks can use the mapping user to determine who took this action
resource.user = current_user if current_user.present? # current_user should always be present
update_action
respond_with_resource
end
def destroy
# this is done so that the model hooks can use the mapping user to determine who took this action
resource.user = current_user if current_user.present? # current_user should always be present
destroy_action
head :no_content
end
end
end
end