We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# lib/service.rb module Service extend ActiveSupport::Concern included do def self.call(*args) new(*args).call end end end
# Gemfile gem 'virtus' # lib/attributable_service.rb module AttributableService extend ActiveSupport::Concern included do include Service include Virtus.model end end
module Users class Create include AttributableService attribute :params, Hash attribute :password, String def call user.password = password user.save user end private def user @user ||= User.new(params) end end
Users::Create.call(params: params, password: 'asdf')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Service
With Attributes
Using
The text was updated successfully, but these errors were encountered: