Class: Tasks::Accessions::Verify::MaterialController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/accessions/verify/material_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#get_data_to_verifyObject (protected)

The context (identifier, collection_object or container) is asserted in logic prior to gathering data, so do not fork logic futher here.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/tasks/accessions/verify/material_controller.rb', line 13

def get_data_to_verify

  @collection_objects = []



  @identifier = nil
  @container  = nil

  case params[:by].to_sym
  when :container
    @container = Container.find(params[:id])
    @collection_objects = @container.collection_objects
    @identifier = @container.identifiers.first
  when :collection_object
    o                   = CollectionObject.find(params[:id])
    @collection_objects = [o]
    @container          = o.container
    @identifier         = o.identifiers.first if o.identifiers.any?
  when :identifier
    @identifier = Identifier.find(params[:id])
    o = @identifier.identifier_object
    if o.class == Container
      @container = o
    elsif o.class == CollectionObject
      @collection_objects = [o]
    else
      # raise an error
    end
  end
  @breakdown = CollectionObject.breakdown_status(@collection_objects.to_a)
end

#indexObject



6
7
# File 'app/controllers/tasks/accessions/verify/material_controller.rb', line 6

def index
end