app/models/api/assemblies.rb
# The /assemblies just returns an id of assembly. dig recursively to get the full content of it.
#     assemblies : :id  => ASM0001
#          assembly: :id => ASC0001
#              component :id => CMP0001
The /assemblies just returns an id of assembly. dig recursively to get the full content of it.
The / assemblies just returns an id of assembly . dig recursively to get the full content of it .
def dig_assembly(tmp_assemblies_collection, api_params)
            @baked = tmp_assemblies_collection.map do |one_assemblies|
                a1 = one_assemblies.assemblies.map do |one_assembly|
                    unless one_assembly.empty?
                        Api::Assembly.new.show(api_params.merge(id: one_assembly, asms_id: one_assemblies.id)).baked
                    end
                end
                a1
            end
            filter(api_params[:filter]) unless api_params[:filter] == ALL
            Rails.logger.debug "\033[36m>-- ASB'S: #{@baked.class} START\33[0m"
            Rails.logger.debug "\033[1m#{@baked.to_yaml}\33[22m"
            Rails.logger.debug "\033[36m> ASB'S: END\033[0m"
        end
def dig_assembly ( tmp_assemblies_collection , api_params ) @baked = tmp_assemblies_collection . map do | one_assemblies | a1 = one_assemblies . assemblies . map do | one_assembly | unless one_assembly . empty? Api :: Assembly . new . show ( api_params . merge ( id : one_assembly , asms_id : one_assemblies . id ) ) . baked end end a1 end filter ( api_params [ :filter ] ) unless api_params [ :filter ] == ALL Rails . logger . debug "\033[36m>-- ASB'S: #{@baked.class} START\33[0m" Rails . logger . debug "\033[1m#{@baked.to_yaml}\33[22m" Rails . logger . debug "\033[36m> ASB'S: END\033[0m" end
The /assemblies just returns an id of assembly.
The / assemblies just returns an id of assembly .
# First step iterate over the [Aid1, Aid2] and make @baked => A[ASM1, ASM2..ASMn]
tmp_assemblies_collection
api_params