-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove lib
folder from autoload path
#859
Conversation
- Load extensions explicitly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a copy-paste, but noticed a few things we might improve along the way
@@ -407,4 +400,26 @@ def session_timeout_reached? | |||
timeout = 5.minutes | |||
epp_session.updated_at < (Time.zone.now - timeout) | |||
end | |||
|
|||
def iptables_counter_update | |||
return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first part of this condition can be skipped, it's contained within the second one:
2.3.7 :004 > ''.blank?
=> true
2.3.7 :005 > '' != 'true'
=> true
2.3.7 :006 > nil != 'true'
=> true
2.3.7 :009 > 'false' != 'true'
=> true
2.3.7 :008 > 'true' != 'true'
=> false
|
||
def iptables_counter_update | ||
return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true' | ||
return if current_user.blank? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's also a bit weird, current_user
shouldn't be a String
, it should be an instance of User
or Nil
.
return unless current_user
should communicate the intent better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't a see the point in improving code structure only. I think the whole feature should be refactored, which requires some effort and is definitely a topic of another branch/ticket.
9ef2202
to
7a5a46b
Compare
Test: