Sha256: d8a28ca0abb5d77b404c4e045a2351239be1ec8f5a291caf4e2bf963bb31f3f9

Contents?: true

Size: 524 Bytes

Versions: 36

Compression:

Stored size: 524 Bytes

Contents

# Form Object for the filters form

module Effective
  class DatatableFiltersForm
    include ActiveModel::Model

    attr_accessor :scope

    def initialize(datatable:)
      # Assign the current value of scope
      assign_attributes(scope: datatable.state[:scope])

      # Create an attr_accesor for each filter and assign value
      datatable._filters.each do |name, options|
        self.class.send(:attr_accessor, name)
        assign_attributes(name => datatable.state[:filter][name])
      end
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
effective_datatables-4.30.1 app/models/effective/datatable_filters_form.rb
effective_datatables-4.30.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.29.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.26.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.25.3 app/models/effective/datatable_filters_form.rb
effective_datatables-4.25.2 app/models/effective/datatable_filters_form.rb
effective_datatables-4.25.1 app/models/effective/datatable_filters_form.rb
effective_datatables-4.25.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.24.2 app/models/effective/datatable_filters_form.rb
effective_datatables-4.24.1 app/models/effective/datatable_filters_form.rb
effective_datatables-4.24.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.23.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.22.3 app/models/effective/datatable_filters_form.rb
effective_datatables-4.22.2 app/models/effective/datatable_filters_form.rb
effective_datatables-4.22.1 app/models/effective/datatable_filters_form.rb
effective_datatables-4.22.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.21.1 app/models/effective/datatable_filters_form.rb
effective_datatables-4.21.0 app/models/effective/datatable_filters_form.rb
effective_datatables-4.20.6 app/models/effective/datatable_filters_form.rb
effective_datatables-4.20.5 app/models/effective/datatable_filters_form.rb