Add and apply DuplicateMethods rubocop rule
These methods were defined with `attr_reader` (or accessor in some cases) and then they were redefined.
This commit is contained in:
@@ -120,6 +120,9 @@ Layout/TrailingWhitespace:
|
||||
Lint/AmbiguousRegexpLiteral:
|
||||
Enabled: true
|
||||
|
||||
Lint/DuplicateMethods:
|
||||
Enabled: true
|
||||
|
||||
Lint/LiteralAsCondition:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Budget
|
||||
class Result
|
||||
|
||||
attr_accessor :budget, :heading, :money_spent, :current_investment
|
||||
attr_accessor :budget, :heading, :current_investment
|
||||
|
||||
def initialize(budget, heading)
|
||||
@budget = budget
|
||||
|
||||
@@ -2,7 +2,7 @@ class CommentTree
|
||||
|
||||
ROOT_COMMENTS_PER_PAGE = 10
|
||||
|
||||
attr_reader :root_comments, :commentable, :page, :order
|
||||
attr_reader :commentable, :page, :order
|
||||
|
||||
def initialize(commentable, page, order = "confidence_score", valuations: false)
|
||||
@commentable = commentable
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class EmailDigest
|
||||
|
||||
attr_accessor :user, :notifications
|
||||
attr_accessor :user
|
||||
|
||||
def initialize(user)
|
||||
@user = user
|
||||
|
||||
Reference in New Issue
Block a user