Skip to content

Instantly share code, notes, and snippets.

@groony
Created July 2, 2018 08:35
Show Gist options
  • Save groony/1fe8af91257b34aae64c9bbb18a4d38a to your computer and use it in GitHub Desktop.
Save groony/1fe8af91257b34aae64c9bbb18a4d38a to your computer and use it in GitHub Desktop.
Application service for performify
class ApplicationService < Performify::Base
def initialize(*params)
params = params.try(:first).try(:deep_symbolize_keys) || {}
@current_user = params.delete(:current_user)
@args = params
prepare_instance
fail!(with_callbacks: false) if errors?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment