Added Rails/Delegate Rubucop Cop

This commit is contained in:
divyanshumehta 2017-05-21 21:02:30 +05:30
parent fa56ff7f6d
commit 4824537aeb
3 changed files with 5 additions and 9 deletions

View file

@ -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.

View file

@ -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.

View file

@ -3,7 +3,5 @@ class SpeakerSerializer < ActiveModel::Serializer
attributes :name, :affiliation, :biography
def name
object.name
end
delegate :name, to: :object
end