Module: Datagrid::ActiveModel

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/datagrid/active_model.rb

Overview

Required to be ActiveModel compatible

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#param_keyString

Returns URL query parameter name of the grid class.

Returns:

  • (String)

    URL query parameter name of the grid class



26
27
28
# File 'lib/datagrid/active_model.rb', line 26

def param_key
  param_name
end

#param_nameString

Returns URL query parameter name of the grid class.

Returns:

  • (String)

    URL query parameter name of the grid class



21
22
23
# File 'lib/datagrid/active_model.rb', line 21

def param_name
  self.class.param_name
end

#persisted?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/datagrid/active_model.rb', line 34

def persisted?
  false
end

#to_keyObject



30
31
32
# File 'lib/datagrid/active_model.rb', line 30

def to_key
  [self.class.param_name]
end

#to_modelObject



38
39
40
# File 'lib/datagrid/active_model.rb', line 38

def to_model
  self
end

#to_paramObject



42
43
44
# File 'lib/datagrid/active_model.rb', line 42

def to_param
  param_name
end