Sha256: ca070337b68ff4e502ba99a4d107f1d140a3ed62e2f7f04e3177b22649eb1b66

Contents?: true

Size: 1.13 KB

Versions: 66

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

module Effective
  module EffectiveDatatable
    module Dsl

      def bulk_actions(&block)
        define_method('initialize_bulk_actions') { dsl_tool.instance_exec(&block); dsl_tool.bulk_actions_col }
      end

      def charts(&block)
        define_method('initialize_charts') { dsl_tool.instance_exec(&block) }
      end

      def collection(apply_belongs_to: true, apply_scope: true, &block)
        define_method('initialize_collection') {
          self._collection_apply_belongs_to = apply_belongs_to
          self._collection_apply_scope = apply_scope

          self._collection = dsl_tool.instance_exec(&block)
        }
      end

      def datatable(&block)
        define_method('initialize_datatable') do
          dsl_tool.in_datatables_do_block = true
          dsl_tool.instance_exec(&block)
          dsl_tool.in_datatables_do_block = false

          self.source_location = block.source_location.first if block.respond_to?(:source_location)
        end
      end

      def filters(&block)
        define_method('initialize_filters') { dsl_tool.instance_exec(&block) }
      end

    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
effective_datatables-4.32.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.31.4 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.31.3 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.31.2 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.31.1 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.31.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.30.2 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.30.1 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.30.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.29.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.26.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.25.3 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.25.2 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.25.1 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.25.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.24.2 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.24.1 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.24.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.23.0 app/models/effective/effective_datatable/dsl.rb
effective_datatables-4.22.3 app/models/effective/effective_datatable/dsl.rb