thegreatape/literate-minuteman

View on GitHub
app/models/sync_errors_presenter.rb

Summary

Maintainability
A
0 mins
Test Coverage
class SyncErrorsPresenter
  def library_systems
    @library_systems ||= Book.pluck('distinct json_object_keys(sync_errors)').map do |id|
      LibrarySystem.find(id)
    end
  end

  def [](library_system)
    Book.where("sync_errors->>? <> ''", library_system.id)
  end
end