run rubocp --fix

This commit is contained in:
Michael Ball 2021-02-24 09:47:56 -08:00
parent 1ca72dcf74
commit 2b2745ade9
26 changed files with 104 additions and 107 deletions

View file

@ -86,7 +86,7 @@ class Conference < ApplicationRecord
has_many :highlighted_events,
-> { where(state: :confirmed, is_highlight: true) },
through: :program,
source: :events
source: :events
has_many :event_types, through: :program
has_many :surveys, as: :surveyable, dependent: :destroy do

View file

@ -310,7 +310,6 @@ class Event < ApplicationRecord
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
end
##
# Returns true or false, if the event is already over or not
#

View file

@ -14,7 +14,7 @@
#
class EventUser < ApplicationRecord
ROLES = [%w[Speaker speaker], %w[Submitter submitter], %w[Moderator moderator],
%w[Volunteer volunteer]]
%w[Volunteer volunteer]]
belongs_to :event, touch: true
belongs_to :user

View file

@ -37,7 +37,7 @@ class Payment < ApplicationRecord
end
def stripe_description
#"ticket purchases(#{user.username})"
# "ticket purchases(#{user.username})"
"Tickets for #{conference.title} #{user.name} #{user.email}"
end

View file

@ -85,7 +85,7 @@ class Registration < ApplicationRecord
def user_has_registration_ticket
return if conference.registration_ticket_required? &&
TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
errors.add(:base, 'You must purchase a registration ticket before registering')
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?

View file

@ -122,6 +122,7 @@ end
def count_purchased_registration_tickets(conference, purchases)
# TODO: WHAT CAUSED THIS???
return 0 unless purchases
conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
sum + purchases[registration_ticket.id.to_s].to_i
end

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
@ -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