Merge pull request #1378 from BelieveC/EnableDoubleNegation

Fixes #1374 to Enable Style/DoubleNegation Rubocop
This commit is contained in:
Ana María Martínez Gómez 2017-03-21 11:44:56 +01:00 committed by GitHub
commit 4b418238d2
3 changed files with 7 additions and 8 deletions

View file

@ -122,6 +122,10 @@ Style/TrailingBlankLines:
Style/TrailingWhitespace:
Enabled: true
# Checks for uses of double negation (!!) to convert something to a boolean value.
Style/DoubleNegation:
Enabled: true
AllCops:
Include:
- '**/Rakefile'

View file

@ -246,11 +246,6 @@ Style/Documentation:
Style/DotPosition:
Enabled: false
# Offense count: 5
Style/DoubleNegation:
Exclude:
- 'app/models/conference.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/ElseAlignment:

View file

@ -838,7 +838,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> If conference has a venue object.
# * +False+ -> IF conference has no venue object.
def venue_set?
!!venue
venue.present?
end
##
@ -848,7 +848,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> If conference has a cfp object.
# * +False+ -> If conference has no cfp object.
def cfp_set?
!!program.cfp
program.cfp.present?
end
##
@ -858,7 +858,7 @@ class Conference < ActiveRecord::Base
# * +True+ -> If conference has a start and a end date.
# * +False+ -> If conference has no start or end date.
def registration_date_set?
!!registration_period && !!registration_period.start_date && !!registration_period.end_date
registration_period.present? && registration_period.start_date.present? && registration_period.end_date.present?
end
# Calculates the distribution from events.