Fix some useless access modifiers in the code

This commit is contained in:
Grzegorz Bizon 2016-06-30 14:41:19 +02:00
parent 1cd573ee7f
commit c0ebfea6ba
4 changed files with 14 additions and 20 deletions

View file

@ -82,8 +82,6 @@ class Import::BitbucketController < Import::BaseController
go_to_bitbucket_for_permissions go_to_bitbucket_for_permissions
end end
private
def access_params def access_params
{ {
bitbucket_access_token: session[:bitbucket_access_token], bitbucket_access_token: session[:bitbucket_access_token],

View file

@ -61,8 +61,6 @@ class Import::GitlabController < Import::BaseController
go_to_gitlab_for_permissions go_to_gitlab_for_permissions
end end
private
def access_params def access_params
{ gitlab_access_token: session[:gitlab_access_token] } { gitlab_access_token: session[:gitlab_access_token] }
end end

View file

@ -142,8 +142,6 @@ module DiffHelper
toggle_whitespace_link(url, options) toggle_whitespace_link(url, options)
end end
private
def hide_whitespace? def hide_whitespace?
params[:w] == '1' params[:w] == '1'
end end

View file

@ -1,6 +1,20 @@
module TokenAuthenticatable module TokenAuthenticatable
extend ActiveSupport::Concern extend ActiveSupport::Concern
private
def write_new_token(token_field)
new_token = generate_token(token_field)
write_attribute(token_field, new_token)
end
def generate_token(token_field)
loop do
token = Devise.friendly_token
break token unless self.class.unscoped.find_by(token_field => token)
end
end
class_methods do class_methods do
def authentication_token_fields def authentication_token_fields
@token_fields || [] @token_fields || []
@ -32,18 +46,4 @@ module TokenAuthenticatable
end end
end end
end end
private
def write_new_token(token_field)
new_token = generate_token(token_field)
write_attribute(token_field, new_token)
end
def generate_token(token_field)
loop do
token = Devise.friendly_token
break token unless self.class.unscoped.find_by(token_field => token)
end
end
end end