Sha256: 9eb10abc70dc66147d92e79c63c12fe0da4b630c20c2b2939c855dc46fb3c1ab

Contents?: true

Size: 1.15 KB

Versions: 7

Compression:

Stored size: 1.15 KB

Contents

require 'ui_bibz/ui/ux/table/components/columns'
require 'ui_bibz/ui/ux/table/components/column'
module UiBibz::Ui::Ux
  class Store

    attr_accessor :records

    # Store Use WillPaginate store methods
    def initialize store
      @records = store.records
      @store   = store
      @model   = store.model
    end

    def total_pages
      @records.total_pages
    end

    def per_page
      @records.per_page
    end

    def total_entries
      @records.total_entries
    end

    def id
      @store.id
    end

    def sort
      @store.sort
    end

    def direction
      @store.direction
    end

    def searchable_attributes
      @store.searchable_attributes
    end

    def current_page
      @records.current_page
    end

    def limit_value
      @records.limit_value
    end

    def columns
      @columns ||= Columns.new model.new.attributes.keys.map{ |record| Column.new(record, { name: record.humanize }) }
    end

    def model
      @model
    end

    def search
      @store.search
    end

    def controller
      @store.controller
    end

    def action
      @store.action
    end

    def param_id
      @store.param_id
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ui_bibz-1.1.7 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.6 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.5 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.4 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.3 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.2 lib/ui_bibz/ui/ux/table/components/store.rb
ui_bibz-1.1.1 lib/ui_bibz/ui/ux/table/components/store.rb