run rubocp --fix
This commit is contained in:
parent
1ca72dcf74
commit
2b2745ade9
26 changed files with 104 additions and 107 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserDatatable < AjaxDatatablesRails::Base
|
class UserDatatable < AjaxDatatablesRails::Base
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ module ConferenceHelper
|
||||||
|
|
||||||
def short_ticket_description(ticket)
|
def short_ticket_description(ticket)
|
||||||
return unless ticket.description
|
return unless ticket.description
|
||||||
|
|
||||||
markdown(ticket.description.split("\n").first&.strip)
|
markdown(ticket.description.split("\n").first&.strip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,6 @@ class Event < ApplicationRecord
|
||||||
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
|
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns true or false, if the event is already over or not
|
# Returns true or false, if the event is already over or not
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Payment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def stripe_description
|
def stripe_description
|
||||||
#"ticket purchases(#{user.username})"
|
# "ticket purchases(#{user.username})"
|
||||||
"Tickets for #{conference.title} #{user.name} #{user.email}"
|
"Tickets for #{conference.title} #{user.name} #{user.email}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ end
|
||||||
def count_purchased_registration_tickets(conference, purchases)
|
def count_purchased_registration_tickets(conference, purchases)
|
||||||
# TODO: WHAT CAUSED THIS???
|
# TODO: WHAT CAUSED THIS???
|
||||||
return 0 unless purchases
|
return 0 unless purchases
|
||||||
|
|
||||||
conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
|
conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
|
||||||
sum + purchases[registration_ticket.id.to_s].to_i
|
sum + purchases[registration_ticket.id.to_s].to_i
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,8 @@ class User < ApplicationRecord
|
||||||
[:database_authenticatable, :registerable,
|
[:database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
|
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
|
||||||
:omniauthable,
|
:omniauthable,
|
||||||
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]
|
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]]
|
||||||
# omniauth_providers: [:google, :discourse]
|
# omniauth_providers: [:google, :discourse]
|
||||||
]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
devise(*devise_modules)
|
devise(*devise_modules)
|
||||||
|
|
@ -206,6 +205,7 @@ class User < ApplicationRecord
|
||||||
# Partials should *not* directly call `gravatar_url`
|
# Partials should *not* directly call `gravatar_url`
|
||||||
def profile_picture(opts = {})
|
def profile_picture(opts = {})
|
||||||
return gravatar_url(opts) unless picture.present?
|
return gravatar_url(opts) unless picture.present?
|
||||||
|
|
||||||
size = (opts[:size] || 0).to_i
|
size = (opts[:size] || 0).to_i
|
||||||
if size < 50
|
if size < 50
|
||||||
picture.tiny.url
|
picture.tiny.url
|
||||||
|
|
@ -346,7 +346,6 @@ class User < ApplicationRecord
|
||||||
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
|
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.empty?
|
def self.empty?
|
||||||
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
#
|
#
|
||||||
# index_conferences_on_organization_id (organization_id)
|
# index_conferences_on_organization_id (organization_id)
|
||||||
#
|
#
|
||||||
#!/bin/env ruby
|
# !/bin/env ruby
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Conference do
|
describe Conference do
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,6 @@ def mock_commercial_request
|
||||||
end
|
end
|
||||||
|
|
||||||
def mock_image_request
|
def mock_image_request
|
||||||
WebMock.stub_request(:post, "https://api.cloudinary.com/v1_1/snapcon/image/destroy").
|
WebMock.stub_request(:post, "https://api.cloudinary.com/v1_1/snapcon/image/destroy")
|
||||||
to_return(status: 200, body: {}.to_json, headers: {})
|
.to_return(status: 200, body: {}.to_json, headers: {})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ module OmniauthMacros
|
||||||
ENV['OSEM_DISCOURSE_KEY'] = 'test key discourse'
|
ENV['OSEM_DISCOURSE_KEY'] = 'test key discourse'
|
||||||
ENV['OSEM_DISCOURSE_SECRET'] = 'test secret discourse'
|
ENV['OSEM_DISCOURSE_SECRET'] = 'test secret discourse'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def mock_auth_new_user
|
def mock_auth_new_user
|
||||||
OmniAuth.config.mock_auth[:google] =
|
OmniAuth.config.mock_auth[:google] =
|
||||||
OmniAuth::AuthHash.new(
|
OmniAuth::AuthHash.new(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue