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

@ -555,9 +555,9 @@ class Conference < ActiveRecord::Base
# * +True+ -> If conference is updated and all other parameters are set
# * +False+ -> Either conference is not updated or one or more parameter is not set
def notify_on_dates_changed?
return false unless self.email_settings.send_on_conference_dates_updated
return false unless email_settings.send_on_conference_dates_updated
# do not notify unless one of the dates changed
return false unless self.start_date_changed? || self.end_date_changed?
return false unless start_date_changed? || end_date_changed?
# do not notify unless the mail content is set up
(!email_settings.conference_dates_updated_subject.blank? && !email_settings.conference_dates_updated_body.blank?)
end
@ -569,9 +569,9 @@ class Conference < ActiveRecord::Base
# * +True+ -> If registration dates is updated and all other parameters are set
# * +False+ -> Either registration date is not updated or one or more parameter is not set
def notify_on_registration_dates_changed?
return false unless self.email_settings.send_on_conference_registration_dates_updated
return false unless email_settings.send_on_conference_registration_dates_updated
# do not notify unless we allow a registration
return false unless self.registration_period
return false unless registration_period
# do not notify unless one of the dates changed
return false unless registration_period.start_date_changed? || registration_period.end_date_changed?
# do not notify unless the mail content is set up
@ -628,8 +628,8 @@ class Conference < ActiveRecord::Base
end
after_create do
self.create_contact
self.create_program
create_contact
create_program
create_roles
end