- Technology: Ruby on Rails (likely v5/6), PostgreSQL, CoffeeScript, jQuery, SCSS, RSpec, Devise, Pundit, Administrate, Que/Sucker Punch, Griddler, Liquid templates, Webpacker[cite: 13, 14, 17, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29].
- Structure: Standard Rails MVC, utilizing service objects (
app/services
) [cite: 14] and model concerns (app/models/concerns
) [cite: 13] for logic organization. Includes background jobs (app/jobs
) [cite: 13] and Pundit policies (app/policies
) [cite: 14] for authorization. - Key Features: Event/Membership management, Scheduling, Invitations/RSVP system, Email processing (incoming via Griddler, outgoing via multiple mailers), Admin dashboard, JSON API[cite: 13, 14, 16].
- Legacy Integration: Contains code (
LegacyConnector
,SyncMembers
,SyncPerson
services) [cite: 14, 448, 453, 463, 464, 473, 474] suggesting integration with an older system, adding complexity. - Testing: Includes a substantial RSpec test suite (
spec/
)[cite:
ere's a checklist for testing the defaults in your new_framework_defaults_6_0.rb
file:
-
# Rails.application.config.action_view.default_enforce_utf8 = false
- Purpose: Stops Rails from automatically adding
accept-charset="UTF-8"
to forms. This was mainly for older IE versions and is usually unnecessary now. - How to Test:
- Enable it (remove the line or set to
false
). - Check your forms in various browsers, especially if you need to support very old ones. Ensure character encoding works as expected, particularly with non-ASCII characters submitted via forms.
- Enable it (remove the line or set to
- Purpose: Stops Rails from automatically adding
-
# Rails.application.config.action_dispatch.use_cookies_with_metadata = true
- Purpose: Embeds purpose and expiry metadata into signed/encrypted cookies to prevent tampering (e.g., copying a cookie's value to another).
Currently on Ruby 3.0:
-
Ruby 3.1: Less dramatic changes than 3.0, but introduces pattern matching refinements and a new debugger.
-
Ruby 3.2: Offers significant performance improvements with YJIT, better error messages, and syntax improvements.
Moving to 3.2 would be a good target as it has performance benefits without being too cutting edge.
You need to restore a PostgreSQL dump to your Docker container. Here's how to do it: | |
1. First, make sure you're working with the correct database container (`wsdb-upgrade`) which is running PostgreSQL 13.1 | |
2. Use the `docker exec` command to pipe the dump file into the `psql` command inside the container: | |
```bash | |
cat workshops_staging.dump | docker exec -i wsdb-upgrade psql -U postgres -d workshops | |
``` |
# Define the oldest and newest commit hashes | |
OLDEST_COMMIT="e8264b948705ec4adefb9caa875c569753134516" | |
NEWEST_COMMIT="5b524772c15f9b7cff017bdb000db40709da28a4" | |
# Create a temporary directory to store the files | |
mkdir -p rails6_upgrade_files | |
# Get list of all changed files between these commits | |
git diff --name-only $OLDEST_COMMIT..$NEWEST_COMMIT > changed_files.txt |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Gemini API Image Mask Visualization</title> | |
<script type="module"> | |
import { GoogleGenerativeAI } from "https://esm.run/@google/generative-ai"; | |
import { marked } from "https://esm.run/marked"; |
# Copyright 2024 Big Vision Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
#!/usr/bin/env python3 | |
import sys | |
import os | |
# --- Configuration --- | |
# Define prefixes of directory paths to exclude. | |
# Any file whose path starts with one of these prefixes will be removed. | |
# Add or remove prefixes as needed. | |
EXCLUDE_PREFIXES = ( |
How to get "Workshops" Rails application up and running on your local machine for development.
Goal: Set up a local development environment for the Workshops application using Docker.
1. Prerequisites:
- Git: To clone the repository.
- Docker: To build and run containerized applications. (Install Docker)
- Docker Compose: To manage multi-container Docker applications. It's usually included with Docker Desktop.