summaryrefslogtreecommitdiff
path: root/app/models/runner.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/runner.rb')
-rw-r--r--app/models/runner.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/runner.rb b/app/models/runner.rb
index e1f685d..7b32cea 100644
--- a/app/models/runner.rb
+++ b/app/models/runner.rb
@@ -17,12 +17,10 @@ class Runner < ActiveRecord::Base
has_one :last_build, ->() { order('id DESC') }, class_name: 'Build'
- attr_accessible :token, :description, :tag_list, :contacted_at, :active
-
before_validation :set_default_values
- scope :specific, ->() { where(id: RunnerProject.select(:runner_id)) }
- scope :shared, ->() { where.not(id: RunnerProject.select(:runner_id)) }
+ scope :specific, ->() { where(is_shared: false) }
+ scope :shared, ->() { where(is_shared: true) }
scope :active, ->() { where(active: true) }
scope :paused, ->() { where(active: false) }
@@ -43,7 +41,7 @@ class Runner < ActiveRecord::Base
end
def shared?
- runner_projects.blank?
+ is_shared
end
def only_for?(project)