diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-04 23:34:42 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-04 23:34:42 +0100 |
commit | 0abce36cd20cdd3579138bee835d28519a5593f2 (patch) | |
tree | 64438cf69f82ec3f8789521e1e4efd1efcda8e09 | |
parent | 053b9d212b8cb39a6808dc5ccf8ea2c1cd5110fa (diff) | |
download | gitlab-ce-0abce36cd20cdd3579138bee835d28519a5593f2.tar.gz |
Update list of allowed attribute updates in Runner
-rw-r--r-- | app/models/ci/runner.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 9749e019d3c..5711be3ae29 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -68,8 +68,8 @@ module Ci ONLINE_CONTACT_TIMEOUT.ago end - def contacted_at - cached_attribute(:contacted_at) || read_attribute(:contacted_at) + def name + cached_attribute(:name) || read_attribute(:name) end def version @@ -80,10 +80,18 @@ module Ci cached_attribute(:revision) || read_attribute(:revision) end + def platform + cached_attribute(:platform) || read_attribute(:platform) + end + def architecture cached_attribute(:architecture) || read_attribute(:architecture) end + def contacted_at + cached_attribute(:contacted_at) || read_attribute(:contacted_at) + end + def set_default_values self.token = SecureRandom.hex(15) if self.token.blank? end @@ -170,7 +178,7 @@ module Ci end def update_cached_info(values) - values = values.slice(:version, :revision, :platform, :architecture) + values = values&.slice(:name, :version, :revision, :platform, :architecture) || {} values[:contacted_at] = Time.now cache_attributes(values) |