summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/build.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/build.rb b/app/models/build.rb
index e5e358a..abbc7b4 100644
--- a/app/models/build.rb
+++ b/app/models/build.rb
@@ -207,7 +207,13 @@ class Build < ActiveRecord::Base
end
def ref
- read_attribute(:ref) || commit.ref
+ build_ref = read_attribute(:ref)
+
+ if build_ref.present?
+ build_ref
+ else
+ commit.ref
+ end
end
def for_tag?