Module: ActiveAdmin::ResourceController::Callbacks

Extended by:
ActiveSupport::Concern
Includes:
Callbacks
Defined in:
lib/active_admin/resource_controller/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#build_resourceObject (protected)



14
15
16
17
18
# File 'lib/active_admin/resource_controller/callbacks.rb', line 14

def build_resource
  object = super
  run_build_callbacks object
  object
end

#create_resource(object) ⇒ Object (protected)



20
21
22
23
24
# File 'lib/active_admin/resource_controller/callbacks.rb', line 20

def create_resource(object)
  run_create_callbacks object do
    save_resource(object)
  end
end

#destroy_resource(object) ⇒ Object (protected)



39
40
41
42
43
# File 'lib/active_admin/resource_controller/callbacks.rb', line 39

def destroy_resource(object)
  run_destroy_callbacks object do
    object.destroy
  end
end

#save_resource(object) ⇒ Object (protected)



26
27
28
29
30
# File 'lib/active_admin/resource_controller/callbacks.rb', line 26

def save_resource(object)
  run_save_callbacks object do
    object.save
  end
end

#update_resource(object, attributes) ⇒ Object (protected)



32
33
34
35
36
37
# File 'lib/active_admin/resource_controller/callbacks.rb', line 32

def update_resource(object, attributes)
  object.attributes = attributes
  run_update_callbacks object do
    save_resource(object)
  end
end