Enable Style/RedundantSelf Rubocop cop

This cop checks for redundant uses of self. It supports autocorrection, so all the offenses where automatically solved.

Closes #1373
This commit is contained in:
Chaitanya 2017-03-28 13:27:52 +05:30
parent 444ceb8960
commit 4427f43bdf
11 changed files with 48 additions and 60 deletions

View file

@ -16,11 +16,11 @@ class Cfp < ActiveRecord::Base
# * +True+ -> If cfp dates is updated and all other parameters are set
# * +False+ -> Either cfp date is not updated or one or more parameter is not set
def notify_on_cfp_date_update?
!self.end_date.blank? && !self.start_date.blank?\
&& (self.start_date_changed? || self.end_date_changed?)\
&& self.program.conference.email_settings.send_on_cfp_dates_updated\
&& !self.program.conference.email_settings.cfp_dates_updated_subject.blank?\
&& !self.program.conference.email_settings.cfp_dates_updated_body.blank?
!end_date.blank? && !start_date.blank?\
&& (start_date_changed? || end_date_changed?)\
&& program.conference.email_settings.send_on_cfp_dates_updated\
&& !program.conference.email_settings.cfp_dates_updated_subject.blank?\
&& !program.conference.email_settings.cfp_dates_updated_body.blank?
end
##
@ -51,7 +51,7 @@ class Cfp < ActiveRecord::Base
end
def remaining_days(date = Date.today)
result = (self.end_date - date).to_i
result = (end_date - date).to_i
result > 0 ? result : 0
end