Skip to content
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

Merged
merged 6 commits into from
Jun 14, 2018
Merged

Conversation

artur-intech
Copy link
Contributor

@artur-intech artur-intech commented Jun 5, 2018

Test:

  • EPP
  • EPP query limit (external)
  • Country drop-down in UI
  • Browse few pages in every portal

Copy link
Contributor

@maciej-szlosarczyk maciej-szlosarczyk left a 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'
Copy link
Contributor

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?
Copy link
Contributor

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.

Copy link
Contributor Author

@artur-intech artur-intech Jun 6, 2018

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.

@artur-intech artur-intech force-pushed the remove-lib-from-autoload-path branch from 9ef2202 to 7a5a46b Compare June 6, 2018 19:09
@vohmar vohmar merged commit 2828f8c into master Jun 14, 2018
@artur-intech artur-intech deleted the remove-lib-from-autoload-path branch June 14, 2018 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants