Sha256: c525c16f826b96760dc5ba4cf9202dbb65142c483d389fd8824041ce25531481

Contents?: true

Size: 640 Bytes

Versions: 1

Compression:

Stored size: 640 Bytes

Contents

module Workarea
  module Admin
    class FlowImportsViewModel < ApplicationViewModel
      def results
        @results ||= PagedArray.from(
          models,
          page,
          per_page,
          models.total_count
        )
      end

      def models
        @models ||= FlowIo::Import
          .all
          .page(page)
          .per(per_page)
          .order(created_at: :desc)
      end

      def ttl
        Workarea.config.data_file_operation_ttl
      end

      private

        def per_page
          Workarea.config.per_page
        end

        def page
          options[:page] || 1
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
workarea-flow_io-1.2.1 app/view_models/workarea/admin/flow_imports_view_model.rb