foreman-tasks 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,8 +22,12 @@ module ForemanTasks
22
22
  scoped_search :in => :owners, :on => :login, :complete_value => true, :rename => "owner.login", :ext_method => :search_by_owner
23
23
  scoped_search :in => :owners, :on => :firstname, :complete_value => true, :rename => "owner.firstname", :ext_method => :search_by_owner
24
24
 
25
-
26
25
  scope :active, -> { where('state != ?', :stopped) }
26
+ scope :for_resource,
27
+ (lambda do |resource|
28
+ joins(:locks).where(:"foreman_tasks_locks.resource_id" => resource.id,
29
+ :"foreman_tasks_locks.resource_type" => resource.class.name)
30
+ end)
27
31
 
28
32
  def input
29
33
  {}
@@ -1,6 +1,8 @@
1
1
  module ForemanTasks
2
2
  class Task::DynflowTask < ForemanTasks::Task
3
3
 
4
+ scope :for_action, ->(action_class) { where(label: action_class.name) }
5
+
4
6
  def update_from_dynflow(data, planned)
5
7
  self.external_id = data[:id]
6
8
  self.started_at = data[:started_at]
@@ -48,8 +50,6 @@ module ForemanTasks
48
50
  end
49
51
  end
50
52
 
51
- protected
52
-
53
53
  def main_action
54
54
  return @main_action if @main_action
55
55
  execution_plan.root_plan_step.action execution_plan
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-06 00:00:00.000000000 Z
12
+ date: 2014-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails