Class: UpdateSnippet

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
app/interactors/update_snippet.rb

Instance Method Summary collapse

Instance Method Details

#callObject


4
5
6
7
8
9
# File 'app/interactors/update_snippet.rb', line 4

def call
  return if snippet.update(params)

  snippet.pieces.build if snippet.pieces.count < 1
  context.fail!
end