Skip to content

Instantly share code, notes, and snippets.

@joegaudet
Created January 3, 2018 16:49
Show Gist options
  • Save joegaudet/e355a31031e232bdb313cb791437cdac to your computer and use it in GitHub Desktop.
Save joegaudet/e355a31031e232bdb313cb791437cdac to your computer and use it in GitHub Desktop.
class SomeServiceWithApplyAndCall < CRUD::CreateService
def apply(attributes, to_one, to_many, options)
self.(attributes[:name], to_one[:foo], to_many[:bar])
end
def call(name, foo_id, bar_ids)
# the real service stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment