Browse Source

Apply Rubocop Style/RedundantAssignment (#23452)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
8c1b65c7dd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions
  1. +1
    -2
      app/models/concerns/omniauthable.rb
  2. +1
    -2
      app/models/setting.rb

+ 1
- 2
app/models/concerns/omniauthable.rb View File

@ -97,8 +97,7 @@ module Omniauthable
def ensure_valid_username(starting_username)
starting_username = starting_username.split('@')[0]
temp_username = starting_username.gsub(/[^a-z0-9_]+/i, '')
validated_username = temp_username.truncate(30, omission: '')
validated_username
temp_username.truncate(30, omission: '')
end
end
end

+ 1
- 2
app/models/setting.rb View File

@ -23,7 +23,7 @@ class Setting < RailsSettings::Base
def [](key)
return super(key) unless rails_initialized?
val = Rails.cache.fetch(cache_key(key, nil)) do
Rails.cache.fetch(cache_key(key, nil)) do
db_val = object(key)
if db_val
@ -35,7 +35,6 @@ class Setting < RailsSettings::Base
default_settings[key]
end
end
val
end
def all_as_records

Loading…
Cancel
Save