Module: Datagrid::Core

Defined in:
lib/datagrid/core.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/datagrid/core.rb', line 7

def self.included(base)
  base.extend         ClassMethods
  base.class_eval do
    class_attribute :scope_value

    class_attribute :datagrid_attributes, instance_writer: false
    self.datagrid_attributes = []

    class_attribute :dynamic_block, :instance_writer => false
    class_attribute :forbidden_attributes_protection, instance_writer: false
    self.forbidden_attributes_protection = false
    if defined?(::ActiveModel::AttributeAssignment)
      include ::ActiveModel::AttributeAssignment
    end
  end
  base.send :include, InstanceMethods
end