summaryrefslogtreecommitdiff
path: root/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-21 13:48:12 +0000
committerRémy Coutable <remy@rymai.me>2017-06-21 13:48:12 +0000
commit0430b7644101fc70ed4be6bf69ccf05b900f4cdf (patch)
tree3ea258c4da6e0f9c6e0f7523191fdb0a64a15c73 /db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
parent78ee24ba53a4a44d829613495ec0d5f1bbb5a9ee (diff)
downloadgitlab-ce-0430b7644101fc70ed4be6bf69ccf05b900f4cdf.tar.gz
Enable Style/DotPosition Rubocop :cop:
Diffstat (limited to 'db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb')
-rw-r--r--db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb b/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
index c67690642c9..33908ae1156 100644
--- a/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
+++ b/db/migrate/20170503140202_turn_nested_groups_into_regular_groups_for_mysql.rb
@@ -87,8 +87,8 @@ class TurnNestedGroupsIntoRegularGroupsForMysql < ActiveRecord::Migration
while current&.parent_id
# We're using find_by(id: ...) here to deal with cases where the
# parent_id may point to a missing row.
- current = Namespace.unscoped.select([:id, :parent_id]).
- find_by(id: current.parent_id)
+ current = Namespace.unscoped.select([:id, :parent_id])
+ .find_by(id: current.parent_id)
ancestors << current.id if current
end
@@ -99,11 +99,11 @@ class TurnNestedGroupsIntoRegularGroupsForMysql < ActiveRecord::Migration
# Returns a relation containing all the members that have access to any of
# the current namespace's parent namespaces.
def all_members_for(namespace)
- Member.
- unscoped.
- select(['user_id', 'MAX(access_level) AS access_level']).
- where(source_type: 'Namespace', source_id: ancestors_for(namespace)).
- group(:user_id)
+ Member
+ .unscoped
+ .select(['user_id', 'MAX(access_level) AS access_level'])
+ .where(source_type: 'Namespace', source_id: ancestors_for(namespace))
+ .group(:user_id)
end
def bulk_insert_members(rows)