app/models/logical/naf/construction_zone/work_order.rb in naf-2.1.5 vs app/models/logical/naf/construction_zone/work_order.rb in naf-2.1.6

- old
+ new

@@ -47,37 +47,37 @@ application_run_group_restriction_id: application_run_group_restriction.id, application_run_group_name: application_run_group_name, application_run_group_limit: application_run_group_limit, priority: priority, application_id: application.try(:id), + application_schedule_id: application_schedule.try(:id) } end def historical_job_affinity_tab_parameters @affinities.map do |affinity| if affinity.is_a? Symbol # short_name of affinity affinity_object = { - :affinity_id => ::Naf::Affinity.find_by_affinity_short_name(affinity).try(:id) + affinity_id: ::Naf::Affinity.find_by_affinity_short_name(affinity).try(:id) } raise "no affinity provided" if affinity_object[:affinity_id].nil? affinity_object elsif affinity.is_a? ::Naf::Affinity { - :affinity_id => affinity.id + affinity_id: affinity.id } elsif affinity.is_a? ::Naf::Machine # affinity_for machine { - :affinity_id => affinity.affinity.id + affinity_id: affinity.affinity.id } elsif affinity.is_a? ::Naf::ApplicationScheduleAffinityTab # affinity_for application_schedule_affinity_tab elsif affinity.is_a? Hash # should have key: :affinity_id or :affinity_short_name or :affinity_name # may have key: :affinity_parameter - affinity_object = { - } + affinity_object = {} if affinity.has_key?(:affinity_id) affinity_object[:affinity_id] = affinity[:affinity_id] elsif affinity.has_key?(:affinity_name) affinity_object[:affinity_id] = ::Naf::Affinity.find_by_affinity_name(affinity[:affinity_name]).try(:id) elsif affinity.has_key?(:affinity_short_name)