- Ruby 71.8%
- C# 11.2%
- JavaScript 5.7%
- HTML 5.6%
- CSS 2.7%
- Other 3%
* Introduce AssessmentSchema as a typed registry for form metadata The form YAML for each assessment was previously walked ad-hoc by three different concerns (FormConfigurable, ValidationConfigurable, AssessmentCompletion) plus a couple of consumers, each reaching into the raw Array[Hash] structure with its own logic. AssessmentSchema loads each config once into immutable Field/Fieldset value objects with typed accessors (#partial_for, #required?, #numeric?, etc.), and the concerns delegate to it. Behaviour and the existing form_fields contract are preserved - including overrides like InspectorCompany.form_fields(user:) - so consumers (PDF builder, controllers) continue to work unchanged. * Remove form_fields shim; migrate all callers to typed schema Removes FormConfigurable#form_fields and AssessmentSchema#to_form_config. The Array[Hash] structure was a transitional shim - every consumer now talks to AssessmentSchema directly via Field/Fieldset value objects. - AssessmentSchema gains #exclude(*field_names) for permission-driven filtering (replaces InspectorCompany's mutate-the-array trick), plus Fieldset.from_raw / Fieldset#without to support it. - ValidationConfigurable calls assessment_schema directly instead of going through form_fields with a rescue. - pdf_generator_service/assessment_block_builder uses assessment.class.assessment_schema and asks Field for #composite_fields and Schema for #add_not_applicable_fields. - user_height_assessments_controller uses schema.find_field(field) and reads .partial / .attributes off the typed Field. - InspectorCompany replaces its 12-line mutating form_fields(user:) override with a 4-line form_schema(user:) that returns assessment_schema.exclude(:notes). The chobble-forms gem's _fields.html.erb partial calls model.class.form_fields(user:), so we override it at app/views/chobble_forms/_fields.html.erb with a schema-based version. The gem prepends its own view path, so an initializer re-prepends app/views after Rails initialisation to make the override win. Form helper methods like form_schema(user:) are now the public API for view-level field metadata; tests that previously stubbed form_fields on anonymous classes now stub assessment_schema instead. * Fix user_height defaulted-zero turbo stream parameter type apply_user_height_defaults populated @fields_defaulted_to_zero from a %w[] array of strings, then handed those strings to the chobble_forms field partials, which expect Symbols. Previously the broken lookup in find_field_config (Symbol-vs-String comparison) silently returned nil and the turbo stream was skipped entirely; the new schema lookup correctly resolves the field, exposing the partial's strict typing. --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| .helix | ||
| .licenses/bundler | ||
| app | ||
| bin | ||
| config | ||
| db | ||
| gems | ||
| hooks | ||
| lib | ||
| log | ||
| public | ||
| sorbet | ||
| spec | ||
| spencers_app | ||
| storage | ||
| test | ||
| tmp | ||
| vendor | ||
| .better-html.yml | ||
| .dockerignore | ||
| .env.example | ||
| .erb-lint-tracking | ||
| .erb_lint.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .licensed.yml | ||
| .parallel_rspec | ||
| .rspec | ||
| .rspec_status | ||
| .rubocop.yml | ||
| .ruby-version | ||
| .standard.yml | ||
| .yamllint.yml | ||
| 14960.md | ||
| attributions.json | ||
| ATTRIBUTIONS.md | ||
| biome.json | ||
| BOUNCING_PILLOW_FIELDS.md | ||
| CLAUDE.md | ||
| code_standard_violations.txt | ||
| config.ru | ||
| Dockerfile | ||
| erb_lint_output.txt | ||
| flake.lock | ||
| flake.nix | ||
| Gemfile | ||
| Gemfile.lock | ||
| ID_GENERATION.md | ||
| LICENSE | ||
| NEW_UNIT_TYPES.md | ||
| OFFLINE.md | ||
| Rakefile | ||
| README.md | ||
| RPII_TODO_08_08.md | ||
| standardrb_output.txt | ||
| terragon-setup.sh | ||
| TEST-QUALITY-CRITERIA.md | ||
| TODO.md | ||
| unfixed_issues.txt | ||
play-test - BS EN 14960 inspection-logging tool
A web app for managing safety inspections of inflatable play equipment like bouncy castles and slides. Developed by Chobble CIC, a community interest company in Manchester, UK.
play-test helps inspectors track and document safety checks on inflatable play equipment. It handles equipment records, inspection forms, photo management, and PDF report generation. Makes repeat inspections of the same units quick and straightforward.
A public instance is live at play-test.co.uk.
Sponsor Development
Features
🎪 Equipment Tracking
- Store unit details, dimensions, and manufacturer info
- Keep inspection history for each piece of equipment
- Upload photos with automatic processing
- Quick access to previous inspection data
📋 Inspection Management
- Seven assessment types covering different safety aspects
- Draft inspections you can edit before finalising
- Generate PDF reports with QR codes
- Built-in safety calculations (anchor points, user capacity, etc.)
👥 Company Management
- Company accounts with branding
- User management and access control
- Upload your logo for PDF reports
- Works on phones, tablets, and desktops
🛠️ Technical Features
- Export any unit or inspection as PDF or JSON
- Shows safety standards right where you need them
- Dark/light theme
- Minimal dependencies
- Full internationalisation support
- No JavaScript required for core functionality
Getting Started
Docker
Quickest way to try it out:
docker pull dockerstefn/play-test
docker run -p 3000:3000 dockerstefn/play-test
Development Setup
There's a Nix flake for easy environment setup:
# Clone the repo
git clone https://github.com/yourusername/play-test.git
cd play-test
# With direnv (recommended)
direnv allow
# Or manually with Nix
nix develop
# Standard Rails setup
bundle install
rails db:create db:migrate db:seed
rails server
Traditional Setup
# Requires Ruby 3.0+ and SQLite
bundle install
rails db:setup
rails server
Testing
Currently over 90% test coverage:
# Run all tests with coverage
bin/test
# Check specific file coverage
bin/coverage_check app/models/inspection.rb
# View detailed HTML report
open coverage/index.html
Test Coverage
If you want to help improve Play-Test, a great way would be to write some more rspec and Capybara tests. Check out coverage.play-test.co.uk for an up-to-date test coverage breakdown.
Tech Stack
- Rails 8.0+ - With minimal gems
- SQLite - No fancy databases (yet?)
- RSpec & Capybara - 90%+ test coverage
- Semantic HTML + MVP.css - Simple CSS
- Turbo for progressive JS enhancement
About Chobble CIC
play-test is developed by Chobble CIC, a community interest company based in Manchester, UK. As a CIC, Chobble is regulated to operate in the public interest rather than for private shareholders — surplus profits are reinvested in community activities like open source development and reduced rates for charities and community organisations.
Chobble's principles include transparency, fair pricing, client ownership of their tools and data, and ethical boundaries. All source code is shared openly, and there's no vendor lock-in.
Contributing
Pull requests welcome! This is an open source project and we're not affiliated with any industry bodies, so improvements from anyone are appreciated.
AGPLv3 - see LICENSE file. This means you can use, modify, and distribute the code, but you must share any improvements.