Hide method

#700
This commit is contained in:
Artur Beljajev 2018-02-14 02:42:00 +02:00
parent fc02e4ad8a
commit 93055acb3a
3 changed files with 8 additions and 11 deletions

2
.reek
View file

@ -34,7 +34,6 @@ UncommunicativeVariableName:
- Admin::SettingsController#create
- Epp::DomainsController#renew
- Epp::DomainsController#update
- Epp::SessionsController#connection_limit_ok?
- Epp::SessionsController#login
- EppController
- EppController#create_full_selectors
@ -172,7 +171,6 @@ DuplicateMethodCall:
- Epp::PollsController#ack_poll
- Epp::PollsController#poll
- Epp::PollsController#req_poll
- Epp::SessionsController#connection_limit_ok?
- Epp::SessionsController#ip_white?
- Epp::SessionsController#login
- Epp::SessionsController#login_params

View file

@ -115,14 +115,6 @@ class Epp::SessionsController < EppController
true
end
def connection_limit_ok?
epp_session_count = EppSession.where(user_id: @api_user.registrar.api_users.ids)
.where('updated_at >= ?', Time.zone.now - 1.second).count
return false if epp_session_count >= 4
true
end
def logout
unless signed_in?
epp_errors << {
@ -151,4 +143,12 @@ class Epp::SessionsController < EppController
def resource
@api_user
end
def connection_limit_ok?
epp_session_count = EppSession.where(user_id: @api_user.registrar.api_users.ids)
.where('updated_at >= ?', Time.zone.now - 1.second).count
return false if epp_session_count >= 4
true
end
end

View file

@ -71,7 +71,6 @@
<path fill="none" stroke="black" d="M532,-320.5C532,-320.5 656,-320.5 656,-320.5 662,-320.5 668,-326.5 668,-332.5 668,-332.5 668,-491.5 668,-491.5 668,-497.5 662,-503.5 656,-503.5 656,-503.5 532,-503.5 532,-503.5 526,-503.5 520,-497.5 520,-491.5 520,-491.5 520,-332.5 520,-332.5 520,-326.5 526,-320.5 532,-320.5"/>
<text text-anchor="middle" x="594" y="-488.3" font-family="Times,serif" font-size="14.00">Epp::SessionsController</text>
<polyline fill="none" stroke="black" points="520,-480.5 668,-480.5 "/>
<text text-anchor="start" x="528" y="-465.3" font-family="Times,serif" font-size="14.00">connection_limit_ok?</text>
<text text-anchor="start" x="528" y="-450.3" font-family="Times,serif" font-size="14.00">hello</text>
<text text-anchor="start" x="528" y="-435.3" font-family="Times,serif" font-size="14.00">ip_white?</text>
<text text-anchor="start" x="528" y="-420.3" font-family="Times,serif" font-size="14.00">login</text>

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Before After
Before After