Sha256: 362033df25dc6bbb5185c7be6abb616b43a53d641684cb8c140bdcd98ca679f9

Contents?: true

Size: 633 Bytes

Versions: 14

Compression:

Stored size: 633 Bytes

Contents

module Effective
  module EffectiveDatatable
    module Attributes

      private

      def initial_attributes(args)
        raise "#{self.class.name}.new() expected Hash like arguments" unless args.kind_of?(Hash)
        args
      end

      def load_attributes!
        if datatables_ajax_request?
          raise 'Expected attributes cookie to be present' unless cookie && cookie[:attributes]
          @attributes = cookie.delete(:attributes)
        end

        unless datatables_ajax_request?
          @attributes[:_n] ||= view.controller_path.split('/')[0...-1].join('/').presence
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
effective_datatables-3.0.16 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.15 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.14 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.13 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.12 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.11 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.10 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.9 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.8 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.7 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.6 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.5 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.4 app/models/effective/effective_datatable/attributes.rb
effective_datatables-3.0.3 app/models/effective/effective_datatable/attributes.rb