diff options
author | Reuben Pereira <rpereira@gitlab.com> | 2019-03-01 17:51:54 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-01 17:51:54 +0300 |
commit | 43e713eb41117138c13ee4b9279321ca4331a302 (patch) | |
tree | 1f2047b2ba5279fdad38b0da18db32ba350311d8 /app/helpers/projects_helper.rb | |
parent | 4471ab81c8484d9942183bd8114a757b8630b8ec (diff) |
Refactor model and spec
- Move some specs into contexts
- Let get_slugs method take a parameter and return a specific slug.
- Add rescues when using Addressable::URI.
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r-- | app/helpers/projects_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index c400302cda3..2ac8ddc5244 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -284,6 +284,20 @@ module ProjectsHelper can?(current_user, :read_environment, @project) end + def error_tracking_setting_project_json + setting = @project.error_tracking_setting + + return if setting.blank? || setting.project_slug.blank? || + setting.organization_slug.blank? + + { + name: setting.project_name, + organization_name: setting.organization_name, + organization_slug: setting.organization_slug, + slug: setting.project_slug + }.to_json + end + private def get_project_nav_tabs(project, current_user) |