Fix Rubocop issues

This commit is contained in:
CactusPuppy 2021-02-18 21:03:28 -08:00
parent a4a6306198
commit d63a22c54e
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
34 changed files with 151 additions and 137 deletions

View file

@ -101,9 +101,8 @@ class User < ApplicationRecord
[:database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
:omniauthable,
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]]
# omniauth_providers: [:google, :discourse]
]
end
devise(*devise_modules)
@ -206,6 +205,7 @@ class User < ApplicationRecord
# Partials should *not* directly call `gravatar_url`
def profile_picture(opts = {})
return gravatar_url(opts) unless picture.present?
size = (opts[:size] || 0).to_i
if size < 50
picture.tiny.url
@ -305,7 +305,7 @@ class User < ApplicationRecord
# TODO: Use a real authorization in the right place....
def manages_volunteers?(conference)
organizer_roles = get_roles['organizer']
organizer_roles&.include?(conference.short_title) # TODO or Volunteer Coorinator.
organizer_roles&.include?(conference.short_title) # TODO: or Volunteer Coorinator.
end
def registered
@ -346,7 +346,6 @@ class User < ApplicationRecord
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
end
def self.empty?
User.count == 1 && User.first.email == 'deleted@localhost.osem'
end