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
e0ce29ad
Commit
e0ce29ad
authored
Sep 02, 2019
by
Peter Leitzen
Committed by
Lin Jen-Shin
Sep 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide filename and line number for `class_eval`
This commit removes one RuboCop offense from its todo file.
parent
d3076322
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/models/service.rb
app/models/service.rb
+4
-4
No files found.
.rubocop_todo.yml
View file @
e0ce29ad
...
...
@@ -570,11 +570,6 @@ Style/EmptyMethod:
Style/Encoding
:
Enabled
:
false
# Offense count: 2
Style/EvalWithLocation
:
Exclude
:
-
'
app/models/service.rb'
# Offense count: 203
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
...
...
app/models/service.rb
View file @
e0ce29ad
...
...
@@ -174,7 +174,7 @@ class Service < ApplicationRecord
# Also keep track of updated properties in a similar way as ActiveModel::Dirty
def
self
.
prop_accessor
(
*
args
)
args
.
each
do
|
arg
|
class_eval
%{
class_eval
<<~
RUBY
,
__FILE__
,
__LINE__
+
1
unless method_defined?(arg)
def
#{
arg
}
properties['
#{
arg
}
']
...
...
@@ -198,7 +198,7 @@ class Service < ApplicationRecord
def
#{
arg
}
_was
updated_properties['
#{
arg
}
']
end
}
RUBY
end
end
...
...
@@ -209,12 +209,12 @@ class Service < ApplicationRecord
self
.
prop_accessor
(
*
args
)
args
.
each
do
|
arg
|
class_eval
%{
class_eval
<<~
RUBY
,
__FILE__
,
__LINE__
+
1
def
#{
arg
}
?
# '!!' is used because nil or empty string is converted to nil
!!ActiveRecord::Type::Boolean.new.cast(
#{
arg
}
)
end
}
RUBY
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