0
0
Fork 0

Fix low-hanging rubocop gripes (#8458)

* rubocop: quit being so picky

* rubocop: miscellany

* rubocop: prefer present to blank
This commit is contained in:
Quint Guvernator 2018-08-26 13:22:46 -04:00 committed by Eugen Rochko
parent a791bac153
commit da13fa5021
9 changed files with 26 additions and 24 deletions

View file

@ -9,7 +9,7 @@ module Expireable
attr_reader :expires_in
def expires_in=(interval)
self.expires_at = interval.to_i.seconds.from_now unless interval.blank?
self.expires_at = interval.to_i.seconds.from_now if interval.present?
@expires_in = interval
end

View file

@ -98,7 +98,7 @@ class User < ApplicationRecord
:reduce_motion, :system_font_ui, :noindex, :theme, :display_sensitive_media, :hide_network,
:default_language, to: :settings, prefix: :setting, allow_nil: false
attr_accessor :invite_code
attr_reader :invite_code
def pam_conflict(_)
# block pam login tries on traditional account
@ -258,7 +258,7 @@ class User < ApplicationRecord
end
def invite_code=(code)
self.invite = Invite.find_by(code: code) unless code.blank?
self.invite = Invite.find_by(code: code) if code.present?
@invite_code = code
end