mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Added Rails/Delegate Rubucop Cop
This commit is contained in:
parent
fa56ff7f6d
commit
4824537aeb
3 changed files with 5 additions and 9 deletions
|
|
@ -188,6 +188,10 @@ Rails:
|
|||
Rails/Validation:
|
||||
Enabled: true
|
||||
|
||||
# Looks for delegations, that could have been created automatically with delegate method
|
||||
Rails/Delegate:
|
||||
Enabled: true
|
||||
|
||||
#################### Performance ###############################
|
||||
|
||||
# Identifies places where gsub can be replaced by tr or delete.
|
||||
|
|
|
|||
|
|
@ -124,12 +124,6 @@ Rails/Blank:
|
|||
Rails/Date:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Rails/Delegate:
|
||||
Exclude:
|
||||
- 'app/serializers/speaker_serializer.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Whitelist.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,5 @@ class SpeakerSerializer < ActiveModel::Serializer
|
|||
|
||||
attributes :name, :affiliation, :biography
|
||||
|
||||
def name
|
||||
object.name
|
||||
end
|
||||
delegate :name, to: :object
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue