Commit c0ebfea6 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Fix some useless access modifiers in the code

parent 4ab9f18c0027
......@@ -82,8 +82,6 @@ def bitbucket_unauthorized
go_to_bitbucket_for_permissions
end
private
def access_params
{
bitbucket_access_token: session[:bitbucket_access_token],
......
......@@ -61,8 +61,6 @@ def gitlab_unauthorized
go_to_gitlab_for_permissions
end
private
def access_params
{ gitlab_access_token: session[:gitlab_access_token] }
end
......
......@@ -142,8 +142,6 @@ def diff_compare_whitespace_link(project, from, to, options)
toggle_whitespace_link(url, options)
end
private
def hide_whitespace?
params[:w] == '1'
end
......
module TokenAuthenticatable
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
def authentication_token_fields
@token_fields || []
......@@ -32,18 +46,4 @@ def add_authentication_token_field(token_field)
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment