1 class Arvados::V1::JobsController < ApplicationController
2 accept_attribute_as_json :script_parameters, Hash
3 accept_attribute_as_json :resource_limits, Hash
4 accept_attribute_as_json :tasks_summary, Hash
5 skip_before_filter :find_object_by_uuid, :only => :queue
8 want_ancestor = @where[:script_version_descends_from]
10 # Check for missing commit_ancestor rows, and create them if
14 includes(:commit_ancestors). # I wish Rails would let me
16 # commit_ancestors I am
19 if o.commit_ancestors.
20 select { |ca| ca.ancestor == want_ancestor }.
21 empty? and !o.script_version.nil?
23 o.commit_ancestors << CommitAncestor.find_or_create_by_descendant_and_ancestor(o.script_version, want_ancestor)
28 select { |ca| ca.ancestor == want_ancestor }.
32 # Now it is safe to do an .includes().where() because we are no
33 # longer interested in jobs that have other ancestors but not
36 includes(:commit_ancestors).
37 where('commit_ancestors.ancestor = ? and commit_ancestors.is = ?',
50 params[:order] ||= 'priority desc, created_at'
51 find_objects_for_index
55 def self._queue_requires_parameters
56 self._index_requires_parameters