Fix order of Ruby's magic string comment and Copyright assignment
Some checks failed
Check usage of free licenses / check-licenses (pull_request) Failing after 1m53s
Run unit tests / unit_tests (pull_request) Failing after 3m11s
Add copyright notice / copyright_notice (pull_request) Successful in 3m16s

This commit is contained in:
Manuel Bustillo 2024-12-28 18:37:47 +01:00
parent 5f2778c97a
commit 55e6cfcd36
79 changed files with 156 additions and 158 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module ApplicationCable
class Channel < ActionCable::Channel::Base
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module ApplicationCable
class Connection < ActionCable::Connection::Base
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class ApplicationController < ActionController::Base
set_current_tenant_through_filter
before_action :set_tenant

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class CaptchaController < ApplicationController
skip_before_action :authenticate_user!
skip_before_action :set_tenant

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class ExpensesController < ApplicationController
def summary
render json: Expenses::TotalQuery.new.call

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class GroupsController < ApplicationController
def index
query_result = Groups::SummaryQuery.new.call.as_json.map(&:deep_symbolize_keys).map do |group|

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'csv'
class GuestsController < ApplicationController

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class SummaryController < ApplicationController
def index
render json: {

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class TablesArrangementsController < ApplicationController
def index
render json: TablesArrangement.order(discomfort: :asc).limit(3).as_json(only: %i[id name discomfort])

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class TokensController < ApplicationController
skip_before_action :authenticate_user!
skip_before_action :set_tenant

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Users
class ConfirmationsController < Devise::ConfirmationsController
clear_respond_to

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Users
class RegistrationsController < Devise::RegistrationsController
clear_respond_to

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Users
class SessionsController < Devise::SessionsController
clear_respond_to

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module TreeNodeExtension
def distance_to_common_ancestor(another_node)
return 0 if self == another_node

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module ApplicationHelper
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module ExpensesHelper
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module GroupsHelper
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module GuestsHelper
end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module TablesArrangementsHelper
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class TableSimulatorJob < ApplicationJob
queue_as :default

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: expenses

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: groups

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: group_affinities

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: guests

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: seats

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: tables_arrangements

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: users

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# == Schema Information
#
# Table name: weddings

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Expenses
class TotalQuery
private attr_reader :wedding

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Groups
class SummaryQuery
def call

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class SerializableGroup < JSONAPI::Serializable::Resource
type 'group'

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class SerializableGuest < JSONAPI::Serializable::Resource
type 'guest'

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class AffinityGroupsHierarchy < Array
include Singleton

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
class LibreCaptcha
def id
HTTParty.post('http://libre-captcha:8888/v2/captcha',

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Tables
class DiscomfortCalculator
class << self

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require_relative '../../extensions/tree_node_extension'
module Tables

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Tables
class Shift
private attr_reader :initial_solution

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Tables
class Swap
private attr_reader :initial_solution

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Tables
class Table < Set
attr_accessor :discomfort, :min_per_table, :max_per_table

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module VNS
class Engine
class << self

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Tree

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :expense do
wedding

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :group_affinity do
group_a factory: %i[group]

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :group do
wedding

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :guest do
group

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :tables_arrangement do
wedding

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :user do
wedding

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
FactoryBot.define do
factory :wedding do
sequence(:slug) { |i| "wedding-#{i}" }

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe Expense do

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe Group do

View File

@ -2,8 +2,6 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe Guest do

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe Seat do

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe TablesArrangement do

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe User do

View File

@ -1,9 +1,9 @@
# Copyright (C) 2024 Manuel Bustillo
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
require 'rails_helper'
RSpec.describe Wedding do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Expenses

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Groups

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'captcha' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'expenses' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'groups' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'guests' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module Swagger
module Schema
USER = {

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'summary' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'tables_arrangements' do

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'users/confirmations' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'users/registrations' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'swagger_helper'
RSpec.describe 'users/sessions' do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Tables
RSpec.describe DiscomfortCalculator do

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Tables

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Tables

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module Tables

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
require 'rails_helper'
module VNS

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
# Copyright (C) 2024 Manuel Bustillo
# frozen_string_literal: true
module SwaggerResponseHelper
TIMESTAMP_FORMAT = '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z'
TIMESTAMP_EXAMPLE = Time.zone.now.iso8601(3)