diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-01-29 22:38:00 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-07 01:12:23 +0300 |
commit | 27f2ca94181880861269a7ddc07ae0d50a656d35 (patch) | |
tree | f93a26a7bf263e448f24230950db618bcd73b8f5 /app/models/merge_request.rb | |
parent | d147688af4adb6bcd6cb0f18797c70a8a451f4fa (diff) |
Add 'View on [env]' link to blobs and individual files in diffs
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 082adcafcc8..0155073a1c9 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -729,6 +729,12 @@ class MergeRequest < ActiveRecord::Base end end + def latest_environment + return @latest_environment if defined?(@latest_environment) + + @latest_environment = Environment.latest_for_commit(environments, diff_head_commit) + end + def state_human_name if merged? "Merged" |