diff options
author | Stan Hu <stanhu@gmail.com> | 2018-08-01 13:13:14 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-01 13:13:14 -0700 |
commit | 883d1dabbf27ca4a4e87d93c2675b25de60d9b50 (patch) | |
tree | 7577eacebe36b8fcf99bcbd1af195e49d53cf3b0 /app/helpers/namespaces_helper.rb | |
parent | 972b0c4cc99279398fa9cd72052378b4798e0a77 (diff) | |
download | gitlab-ce-883d1dabbf27ca4a4e87d93c2675b25de60d9b50.tar.gz |
Fix spec failures with namespace helpers
Diffstat (limited to 'app/helpers/namespaces_helper.rb')
-rw-r--r-- | app/helpers/namespaces_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index e80ac9305ff..834b902ff36 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -9,7 +9,7 @@ module NamespacesHelper .includes(:route) .order('routes.path') users = [current_user.namespace] - selected_id = current_user.namespace.id + selected_id = selected unless extra_group.nil? || extra_group.is_a?(Group) extra_group = Group.find(extra_group) if Namespace.find(extra_group).kind == 'group' @@ -25,7 +25,7 @@ module NamespacesHelper if Ability.allowed?(current_user, :read_group, extra_group) # Assign the value to an invalid primary ID so that the select box works - extra_group.id = -1 if !extra_group.persisted? + extra_group.id = -1 unless extra_group.persisted? selected_id = extra_group.id if selected == :extra_group groups |= [extra_group] end |