Module: Datagrid::ActiveModel

Defined in:
lib/datagrid/active_model.rb

Overview

Required to be ActiveModel compatible

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:


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

def self.included(base)
  base.extend         ClassMethods
  base.class_eval do
    begin
      require 'active_model/naming'
      extend ::ActiveModel::Naming
    rescue LoadError
    end
    begin
      require 'active_model/attributes_assignment'
      extend ::ActiveModel::AttributesAssignment
    rescue LoadError
    end

  end
  base.send :include, InstanceMethods
end