Module: Ephemeron::Validators::Store::AllowedButUnsaved

Defined in:
lib/ephemeron/validators/store/allowed_but_unsaved.rb

Class Method Summary collapse

Class Method Details

.callObject

Raises:



9
10
11
12
13
14
15
16
17
# File 'lib/ephemeron/validators/store/allowed_but_unsaved.rb', line 9

def call
  model = Ephemeron::Store::Finders.find_first_allowed_but_unsaved
  return if model.nil?

  raise(
    PersistenceError,
    "save allowed for #{Ephemeron::Store::Convert.call(model)} but never saved"
  )
end