Class: ActiveAdmin::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/active_admin/resource/model.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource, record) ⇒ Model

Returns a new instance of Model.


4
5
6
7
8
9
10
# File 'lib/active_admin/resource/model.rb', line 4

def initialize(resource, record)
  @record = record

  if resource
    @record.extend(resource.resource_name_extension)
  end
end

Instance Method Details

#to_modelObject


12
13
14
# File 'lib/active_admin/resource/model.rb', line 12

def to_model
  @record
end