Skip to content

Instantly share code, notes, and snippets.

@edlvj
Created August 5, 2019 09:54
Show Gist options
  • Save edlvj/0c88fa78ba4d5146aa0dc587b4dbde39 to your computer and use it in GitHub Desktop.
Save edlvj/0c88fa78ba4d5146aa0dc587b4dbde39 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
# Copyright (c) 2017-2019 SwiftComply
module InspectionActivity
extend ActiveSupport::Concern
def inspection_activity_params
inspection_activity_params = activity_params.dup
inspection_activity_params.merge(action: inspection_activity_action)
end
private
def inspection_activity_action
return 're_opened' if params[:action] == 'open'
return unless params[:commit]
'closed' if params[:commit] == 'close'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment