Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
518a2fae
Commit
518a2fae
authored
Sep 12, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the problem on CreateTableWithForeignKeys cop
parent
a643dbda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
rubocop/cop/migration/create_table_with_foreign_keys.rb
rubocop/cop/migration/create_table_with_foreign_keys.rb
+6
-2
No files found.
rubocop/cop/migration/create_table_with_foreign_keys.rb
View file @
518a2fae
...
...
@@ -35,7 +35,7 @@ module RuboCop
)
PATTERN
def_node_
search
:argument_name
,
<<~
PATTERN
def_node_
matcher
:argument_name?
,
<<~
PATTERN
{(sym $...) (str $...)}
PATTERN
...
...
@@ -87,7 +87,11 @@ module RuboCop
end
def
arguments_to_table_names
(
arguments
)
arguments
.
flat_map
{
|
argument
|
argument_name
(
argument
).
to_a
.
flatten
.
first
.
to_s
.
pluralize
.
to_sym
}
arguments
.
select
{
|
argument
|
argument_name?
(
argument
)
}
.
map
(
&
:value
)
.
map
(
&
:to_s
)
.
map
(
&
:pluralize
)
.
map
(
&
:to_sym
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment