Compare commits
23 Commits
affinity-r
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
f550b8d92c | ||
7c968f555f | |||
1f0c6c2aac | |||
390899524b | |||
|
59e7653064 | ||
d6fd72a45c | |||
889485eaab | |||
105a0ad30c | |||
d03ef173e6 | |||
b86d537cdc | |||
c1774a1c6c | |||
23d09df543 | |||
44dbb7e005 | |||
8a9d0bfdb8 | |||
c6c5a87d8b | |||
acf3b7b82a | |||
0ade367fb5 | |||
91bbae1c63 | |||
e20a366410 | |||
a154e92b6c | |||
65a265b900 | |||
492c8e362a | |||
c5c7ea6d54 |
@ -14,9 +14,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: ruby/setup-ruby@v1.202.0
|
||||
with:
|
||||
ruby-version: '3.3.6'
|
||||
- uses: ruby/setup-ruby@v1.207.0
|
||||
- name: Install project dependencies
|
||||
run: bundle install --jobs `getconf _NPROCESSORS_ONLN`
|
||||
- name: Run license finder
|
||||
|
@ -22,7 +22,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: ruby/setup-ruby@v1.202.0
|
||||
- uses: ruby/setup-ruby@v1.207.0
|
||||
- run: bundle install
|
||||
- run: bundle exec rubocop --force-exclusion --parallel
|
||||
- name: Wait until Postgres is ready to accept connections
|
||||
|
@ -1 +1 @@
|
||||
ruby-3.3.6
|
||||
ruby-3.4.1
|
||||
|
@ -1,8 +1,8 @@
|
||||
# syntax = docker/dockerfile:1
|
||||
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
|
||||
ARG RUBY_VERSION=3.3.6
|
||||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
|
||||
ARG RUBY_VERSION=3.4.1
|
||||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base
|
||||
|
||||
# Rails app lives here
|
||||
WORKDIR /rails
|
||||
@ -16,11 +16,11 @@ ENV RAILS_ENV="production" \
|
||||
RUN apt-get update && apt-get install -y nodejs
|
||||
|
||||
# Throw-away build stage to reduce size of final image
|
||||
FROM base as build
|
||||
FROM base AS build
|
||||
|
||||
# Install packages needed to build gems
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config
|
||||
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config libyaml-dev
|
||||
|
||||
# Install application gems
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
|
@ -1,7 +1,7 @@
|
||||
# syntax = docker/dockerfile:1
|
||||
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
|
||||
ARG RUBY_VERSION=3.3.6
|
||||
ARG RUBY_VERSION=3.4.1
|
||||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
|
||||
|
||||
# Rails app lives here
|
||||
@ -13,7 +13,7 @@ FROM base as build
|
||||
|
||||
# Install packages needed to build gems
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config
|
||||
apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config libyaml-dev
|
||||
|
||||
# Install application gems
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
|
2
Gemfile
2
Gemfile
@ -2,7 +2,7 @@
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
ruby '3.3.6'
|
||||
ruby '3.4.1'
|
||||
gem 'bootsnap', require: false
|
||||
gem 'csv'
|
||||
gem 'importmap-rails'
|
||||
|
41
Gemfile.lock
41
Gemfile.lock
@ -188,6 +188,7 @@ GEM
|
||||
marcel (1.0.4)
|
||||
method_source (1.1.0)
|
||||
mini_mime (1.1.5)
|
||||
mini_portile2 (2.8.8)
|
||||
minitest (5.25.4)
|
||||
money (6.19.0)
|
||||
i18n (>= 0.6.4, <= 2)
|
||||
@ -204,21 +205,22 @@ GEM
|
||||
net-smtp (0.5.0)
|
||||
net-protocol
|
||||
nio4r (2.7.4)
|
||||
nokogiri (1.17.2-aarch64-linux)
|
||||
nokogiri (1.18.1)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.17.2-arm-linux)
|
||||
nokogiri (1.18.1-aarch64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.17.2-arm64-darwin)
|
||||
nokogiri (1.18.1-arm-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.17.2-x86-linux)
|
||||
nokogiri (1.18.1-arm64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.17.2-x86_64-darwin)
|
||||
nokogiri (1.18.1-x86_64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.17.2-x86_64-linux)
|
||||
nokogiri (1.18.1-x86_64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
orm_adapter (0.5.0)
|
||||
parallel (1.26.3)
|
||||
parser (3.3.6.0)
|
||||
parser (3.3.7.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
pg (1.5.9)
|
||||
@ -341,12 +343,12 @@ GEM
|
||||
parser (>= 3.3.1.0)
|
||||
rubocop-factory_bot (2.26.1)
|
||||
rubocop (~> 1.61)
|
||||
rubocop-rails (2.28.0)
|
||||
rubocop-rails (2.29.0)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.52.0, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rspec (3.3.0)
|
||||
rubocop-rspec (3.4.0)
|
||||
rubocop (~> 1.61)
|
||||
rubocop-rspec_rails (2.30.0)
|
||||
rubocop (~> 1.61)
|
||||
@ -521,6 +523,7 @@ CHECKSUMS
|
||||
marcel (1.0.4) sha256=0d5649feb64b8f19f3d3468b96c680bae9746335d02194270287868a661516a4
|
||||
method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
|
||||
mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
|
||||
mini_portile2 (2.8.8) sha256=8e47136cdac04ce81750bb6c09733b37895bf06962554e4b4056d78168d70a75
|
||||
minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
|
||||
money (6.19.0) sha256=ec936fa1e42f2783719241ed9fd52725d0efa628f928feea1eb5c37d5de7daf3
|
||||
msgpack (1.7.2) sha256=59ab62fd8a4d0dfbde45009f87eb6f158ab2628a7c48886b0256f175166baaa8
|
||||
@ -530,15 +533,15 @@ CHECKSUMS
|
||||
net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
|
||||
net-smtp (0.5.0) sha256=5fc0415e6ea1cc0b3dfea7270438ec22b278ca8d524986a3ae4e5ae8d087b42a
|
||||
nio4r (2.7.4) sha256=d95dee68e0bb251b8ff90ac3423a511e3b784124e5db7ff5f4813a220ae73ca9
|
||||
nokogiri (1.17.2-aarch64-linux) sha256=585c8cac6380848b7973bacfd0584628d116810e5f209db25e22d0c32313e681
|
||||
nokogiri (1.17.2-arm-linux) sha256=3d033ad9b09d5b8a203f0f2156053e93a9327a9c7887c0ceb9fa78c71d27280d
|
||||
nokogiri (1.17.2-arm64-darwin) sha256=0c5eb06ba1c112d33c2bb29973b07e2f21c4ddb66c67c9386fd97ff1c5d84686
|
||||
nokogiri (1.17.2-x86-linux) sha256=8c4dd75e35810bdeb7c74943f383ca665baf6aed8fc2b78c1d305094a72794aa
|
||||
nokogiri (1.17.2-x86_64-darwin) sha256=dc5977eb3416e1d501b22b0ed4737bf7604121491405865b887975eacfb3e896
|
||||
nokogiri (1.17.2-x86_64-linux) sha256=e8614ae8d776bd9adb535ca814375e7ae05d7cfa6aa01909e561484f6d70be0b
|
||||
nokogiri (1.18.1) sha256=df18be7e96c34736b6abfdeda80c6e845134fb9afe2fe5d4fbc1cf1f89c68475
|
||||
nokogiri (1.18.1-aarch64-linux-gnu) sha256=35837013800e34342fcbaca305f8c49231f6bd4f779bfa23fe7b4686ae82d5b8
|
||||
nokogiri (1.18.1-arm-linux-gnu) sha256=3b873fd6b0cd1ad7c77e87af701075bdfd14c9a6b2f2965c5e00ed29a5627a37
|
||||
nokogiri (1.18.1-arm64-darwin) sha256=d75193f284c899d225943a8944479faedd995a7573ddd5c8308ffbdf2ec55204
|
||||
nokogiri (1.18.1-x86_64-darwin) sha256=d94e3aa6483577495fc8969d6b4b5c075840ce6b1ab09636a6d4177ad171051d
|
||||
nokogiri (1.18.1-x86_64-linux-gnu) sha256=e516cf16ccde67ed4cc595a2621ca5ddd42562ecb24928914b0045a20a41620e
|
||||
orm_adapter (0.5.0) sha256=aa5d0be5d540cbb46d3a93e88061f4ece6a25f6e97d6a47122beb84fe595e9b9
|
||||
parallel (1.26.3) sha256=d86babb7a2b814be9f4b81587bf0b6ce2da7d45969fab24d8ae4bf2bb4d4c7ef
|
||||
parser (3.3.6.0) sha256=25d4e67cc4f0f7cab9a2ae1f38e2005b6904d2ea13c34734511d0faad038bc3b
|
||||
parser (3.3.7.0) sha256=7449011771e3e7881297859b849de26a6f4fccd515bece9520a87e7d2116119b
|
||||
pg (1.5.9) sha256=761efbdf73b66516f0c26fcbe6515dc7500c3f0aa1a1b853feae245433c64fdc
|
||||
pluck_to_hash (1.0.2) sha256=1599906239716f98262a41493dd7d4cb72e8d83ad3d76d666deacfc5de50a47e
|
||||
pry (0.15.2) sha256=12d54b8640d3fa29c9211dd4ffb08f3fd8bf7a4fd9b5a73ce5b59c8709385b6b
|
||||
@ -578,8 +581,8 @@ CHECKSUMS
|
||||
rubocop (1.70.0) sha256=96751f8440b36a0ac6e9a8ab596900803118d83d6b83f2037bf8b3d7a5bc440e
|
||||
rubocop-ast (1.37.0) sha256=9513ac88aaf113d04b52912533ffe46475de1362d4aa41141b51b2455827c080
|
||||
rubocop-factory_bot (2.26.1) sha256=8de13cd4edcee5ca800f255188167ecef8dbfc3d1fae9f15734e9d2e755392aa
|
||||
rubocop-rails (2.28.0) sha256=4967bed9ea13e6dcab566fea4265a6dd0381db739b305e48930aba1282da2715
|
||||
rubocop-rspec (3.3.0) sha256=79e1b281a689044d1516fefbc52e2e6c06cd367c25ebeaf06a7a198e9071cd7d
|
||||
rubocop-rails (2.29.0) sha256=35bffd140c80671453aafac0e2d5ab5b3dd65736a3fc8f3936ccca226b89c234
|
||||
rubocop-rspec (3.4.0) sha256=8721c13b6a8c9530a7ac481cea9423022f946fcf72428bda8289f8b57e4d4885
|
||||
rubocop-rspec_rails (2.30.0) sha256=888112e83f9d7ef7ad2397e9d69a0b9614a4bae24f072c399804a180f80c4c46
|
||||
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
||||
rubytree (2.1.1) sha256=4925016356a81730e982f1f8c3b5f8da461f18906c77d238bad4c4ba896abd41
|
||||
@ -609,7 +612,7 @@ CHECKSUMS
|
||||
zeitwerk (2.7.1) sha256=0945986050e4907140895378e74df1fe882a2271ed087cc6c6d6b00d415a2756
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.3.6p108
|
||||
ruby 3.4.1p0
|
||||
|
||||
BUNDLED WITH
|
||||
2.6.1
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationCable
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationCable
|
||||
|
@ -1,9 +1,11 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AffinitiesController < ApplicationController
|
||||
before_action :set_group
|
||||
before_action :set_group, except: :reset
|
||||
|
||||
def index
|
||||
overridden = @group.affinities.each_with_object({}) do |affinity, acc|
|
||||
@ -24,7 +26,7 @@ class AffinitiesController < ApplicationController
|
||||
}
|
||||
end
|
||||
|
||||
GroupAffinity.upsert_all(affinities)
|
||||
GroupAffinity.upsert_all(affinities, unique_by: :uindex_group_pair)
|
||||
|
||||
render json: {}, status: :ok
|
||||
rescue ActiveRecord::InvalidForeignKey
|
||||
@ -34,11 +36,29 @@ class AffinitiesController < ApplicationController
|
||||
end
|
||||
|
||||
def default
|
||||
hierarchy = AffinityGroupsHierarchy.new
|
||||
|
||||
for_each_group do |group_id|
|
||||
Tables::DiscomfortCalculator.cohesion_discomfort(id_a: @group.id, id_b: group_id).to_f
|
||||
hierarchy.default_discomfort(@group.id, group_id).to_f
|
||||
end
|
||||
end
|
||||
|
||||
def reset
|
||||
hierarchy = AffinityGroupsHierarchy.new
|
||||
|
||||
affinities = Group.pluck(:id).combination(2).map do |(group_a_id, group_b_id)|
|
||||
{
|
||||
group_a_id:,
|
||||
group_b_id:,
|
||||
discomfort: hierarchy.default_discomfort(group_a_id, group_b_id).to_f
|
||||
}
|
||||
end
|
||||
|
||||
GroupAffinity.upsert_all(affinities, unique_by: :uindex_group_pair)
|
||||
|
||||
render json: {}, status: :ok
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def for_each_group
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CaptchaController < ApplicationController
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ExpensesController < ApplicationController
|
||||
@ -29,6 +31,6 @@ class ExpensesController < ApplicationController
|
||||
private
|
||||
|
||||
def expense_params
|
||||
params.require(:expense).permit(:name, :amount, :pricing_type)
|
||||
params.expect(expense: %i[name amount pricing_type])
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GroupsController < ApplicationController
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'csv'
|
||||
@ -30,6 +32,6 @@ class GuestsController < ApplicationController
|
||||
private
|
||||
|
||||
def guest_params
|
||||
params.require(:guest).permit(:name, :group_id, :status)
|
||||
params.expect(guest: %i[name group_id status])
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SummaryController < ApplicationController
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TablesArrangementsController < ApplicationController
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TokensController < ApplicationController
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Users
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Users
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Users
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module TreeNodeExtension
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationHelper
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ExpensesHelper
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module GroupsHelper
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module GuestsHelper
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module TablesArrangementsHelper
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TableSimulatorJob < ApplicationJob
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# == Schema Information
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Expenses
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Groups
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SerializableGroup < JSONAPI::Serializable::Resource
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SerializableGuest < JSONAPI::Serializable::Resource
|
||||
|
@ -1,9 +1,11 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AffinityGroupsHierarchy < Array
|
||||
include Singleton
|
||||
DEFAULT_DISCOMFORT = 1
|
||||
|
||||
def initialize
|
||||
super
|
||||
@ -14,6 +16,9 @@ class AffinityGroupsHierarchy < Array
|
||||
|
||||
hydrate(group)
|
||||
end
|
||||
|
||||
load_discomforts
|
||||
freeze
|
||||
end
|
||||
|
||||
def find(id)
|
||||
@ -35,8 +40,35 @@ class AffinityGroupsHierarchy < Array
|
||||
@references[id_a].distance_to_common_ancestor(@references[id_b])
|
||||
end
|
||||
|
||||
def discomfort(id_a, id_b)
|
||||
return 0 if id_a == id_b
|
||||
|
||||
@discomforts[uuid_to_int(id_a) + uuid_to_int(id_b)] || DEFAULT_DISCOMFORT
|
||||
end
|
||||
|
||||
def default_discomfort(id_a, id_b)
|
||||
return 0 if id_a == id_b
|
||||
|
||||
dist = distance(id_a, id_b)
|
||||
|
||||
return DEFAULT_DISCOMFORT if dist.nil?
|
||||
|
||||
Rational(dist, dist + 1)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_discomforts
|
||||
@load_discomforts ||= GroupAffinity.pluck(:group_a_id, :group_b_id,
|
||||
:discomfort).each_with_object({}) do |(id_a, id_b, discomfort), acc|
|
||||
acc[uuid_to_int(id_a) + uuid_to_int(id_b)] = discomfort
|
||||
end
|
||||
end
|
||||
|
||||
def uuid_to_int(uuid)
|
||||
uuid.gsub('-', '').hex
|
||||
end
|
||||
|
||||
def hydrate(group)
|
||||
group.children.each do |child|
|
||||
register_child(group.id, child.id)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
class LibreCaptcha
|
||||
|
@ -1,22 +1,15 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Tables
|
||||
class DiscomfortCalculator
|
||||
class << self
|
||||
def cohesion_discomfort(id_a:, id_b:)
|
||||
distance = AffinityGroupsHierarchy.instance.distance(id_a, id_b)
|
||||
|
||||
return 1 if distance.nil?
|
||||
|
||||
Rational(distance, distance + 1)
|
||||
end
|
||||
end
|
||||
|
||||
private attr_reader :table
|
||||
def initialize(table:)
|
||||
private attr_reader :table, :hierarchy
|
||||
def initialize(table:, hierarchy: AffinityGroupsHierarchy.new)
|
||||
@table = table
|
||||
@hierarchy = hierarchy
|
||||
end
|
||||
|
||||
def calculate
|
||||
@ -57,7 +50,7 @@ module Tables
|
||||
#
|
||||
def cohesion_discomfort
|
||||
table.map(&:group_id).tally.to_a.combination(2).sum do |(a, count_a), (b, count_b)|
|
||||
count_a * count_b * self.class.cohesion_discomfort(id_a: a, id_b: b)
|
||||
count_a * count_b * hierarchy.discomfort(a, b)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../../extensions/tree_node_extension'
|
||||
@ -11,6 +13,7 @@ module Tables
|
||||
def initialize(min_per_table:, max_per_table:)
|
||||
@min_per_table = min_per_table
|
||||
@max_per_table = max_per_table
|
||||
@hierarchy = AffinityGroupsHierarchy.new
|
||||
@tables = []
|
||||
end
|
||||
|
||||
@ -33,12 +36,6 @@ module Tables
|
||||
"#{@tables.count} tables, discomfort: #{discomfort}"
|
||||
end
|
||||
|
||||
def pretty_print
|
||||
@tables.map.with_index do |table, i|
|
||||
"Table #{i + 1} (#{table.count} ppl): (#{local_discomfort(table)}) #{table.map(&:name).join(', ')}"
|
||||
end.join("\n")
|
||||
end
|
||||
|
||||
def deep_dup
|
||||
self.class.new(min_per_table: @min_per_table, max_per_table: @max_per_table).tap do |new_distribution|
|
||||
new_distribution.tables = @tables.map(&:dup)
|
||||
@ -66,7 +63,7 @@ module Tables
|
||||
private
|
||||
|
||||
def local_discomfort(table)
|
||||
table.discomfort ||= DiscomfortCalculator.new(table:).calculate
|
||||
table.discomfort ||= DiscomfortCalculator.new(table:, hierarchy:).calculate
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Tables
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Tables
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Tables
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
module VNS
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
@ -1,3 +1,5 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<%= yield %>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<p>Welcome <%= @email %>!</p>
|
||||
|
||||
<p>You can confirm your account email through the link below:</p>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<p>Hello <%= @email %>!</p>
|
||||
|
||||
<% if @resource.try(:unconfirmed_email?) %>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that your password has been changed.</p>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
||||
|
@ -1,5 +1,7 @@
|
||||
<%# Copyright (C) 2024 Manuel Bustillo %>
|
||||
|
||||
<%# Copyright (C) 2024-2025 LibreWeddingPlanner contributors %>
|
||||
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
require_relative 'boot'
|
||||
|
||||
require 'rails'
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
||||
|
||||
require "bundler/setup" # Set up gems listed in the Gemfile.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Load the Rails application.
|
||||
require_relative "application"
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Pin npm packages by running ./bin/importmap
|
||||
|
||||
pin "application"
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
ActsAsTenant.configure do |config|
|
||||
config.require_tenant = !Rails.env.test?
|
||||
end
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
Chroma.define_palette :decreasing_saturation do
|
||||
spin(20).desaturate(40)
|
||||
spin(-20).desaturate(40)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide content security policy.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# config/initializers/cors.rb
|
||||
|
||||
Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Assuming you have not yet modified this file, each configuration option below
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Add new inflection rules using the following format. Inflections
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Define an application-wide HTTP permissions policy. For further
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
Rswag::Api.configure do |c|
|
||||
|
||||
# Specify a root folder where Swagger JSON files are located
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
Rswag::Ui.configure do |c|
|
||||
|
||||
# List the Swagger endpoints that you want to be documented through the
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class Numeric
|
||||
def to_currency
|
||||
Money.from_amount(self, "EUR").format
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# This configuration file will be evaluated by Puma. The top-level methods that
|
||||
# are invoked here are part of Puma's configuration DSL. For more information
|
||||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
Rails.application.routes.draw do
|
||||
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
|
||||
get 'token' => 'tokens#show', as: :token
|
||||
@ -24,6 +26,7 @@ Rails.application.routes.draw do
|
||||
end
|
||||
|
||||
resources :groups, only: %i[index create update destroy] do
|
||||
post 'affinities/reset', to: 'affinities#reset', on: :collection
|
||||
resources :affinities, only: %i[index] do
|
||||
put :bulk_update, on: :collection
|
||||
get :default, on: :collection
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class CreateExpenses < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_enum :pricing_types, ["fixed", "per_person"]
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class CreateGuests < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :guests, id: :uuid do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 1)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 2)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 5)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 6)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This migration comes from acts_as_taggable_on_engine (originally 7)
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class CreateTablesArrangements < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :tables_arrangements, id: :uuid do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class CreateSeats < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :seats, id: :uuid do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class CreateGroups < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :groups, id: :uuid do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class AddParentToGroup < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_reference :groups, :parent, type: :uuid, index: true, foreign_key: { to_table: :groups }
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class AddGroupToGuest < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_reference :guests, :group, null: false, foreign_key: true, type: :uuid
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class AddStatusToGuest < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :guests, :status, :integer, default: 0
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class DropTaggableTables < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
drop_table 'taggings', force: :cascade do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class AddNameToTablesArrangements < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :tables_arrangements, :name, :string, null: false
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class SolidQueueInstall < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table 'solid_queue_blocked_executions', force: :cascade do |t|
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class RemoveEmailFromGuests < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
remove_column :guests, :email, :string
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class AddColorToGroup < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :groups, :color, :string
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Copyright (C) 2024 Manuel Bustillo
|
||||
|
||||
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
||||
|
||||
class MergeGuestNames < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :guests, :name, :string
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user