Created
July 2, 2018 08:35
-
-
Save groony/1fe8af91257b34aae64c9bbb18a4d38a to your computer and use it in GitHub Desktop.
Application service for performify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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