Module: Ephemeron::Validators::Store::Unused

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

Class Method Summary collapse

Class Method Details

.callObject

Raises:



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ephemeron/validators/store/unused.rb', line 9

def call
  models = Ephemeron::Store
           .store
           .filter { |_, model| !model.changed? && !Logger.has?(model, :used) }
           .values
  return if models.empty?

  model_ids = Ephemeron::Store::Convert.call(models)
  raise(
    StoreError,
    "#{model_ids} were added to store but neither fetched nor changed"
  )
end