Commit Graph

14 Commits

Author SHA1 Message Date
3e0f27b357 Extend all test tasks to run against every configured test database
When database.yml defines more than one top-level key starting with "test",
every standard test task (rails test, rails test:models, rails test:system,
rails test:controllers, …) is automatically rewritten at load time to run
the full suite against each configured database in turn.

Single-database setups are completely unaffected — the wrapping code
activates only when test_configs.size > 1, so existing behaviour is
preserved by default.

Convention: test: is the required primary; test_<name>: adds an adapter:
  test_sqlite:
    adapter: sqlite3
    database: db/fixinme_test.sqlite3
  test_pg:
    adapter: postgresql
    ...

Mechanism:
- lib/tasks/test_databases.rake loads after railties/testing.rake (which
  defines all test tasks). For each task in the wrapped set it calls
  Rake::Task[name].clear_actions and re-enhances with a block that loops
  over DB configs, writing a temporary database.yml per database and
  running "rails <task_name>" as a subprocess with RAILS_DATABASE_YML set.
- config/application.rb(.dist): reads RAILS_DATABASE_YML and overrides
  Rails' database config path before initialisation — no monkey-patching
  of the test runner required.
- Adapter gem availability is checked before each run; missing adapters are
  skipped with a hint on which bundle group to enable.
- A formatted summary (✓/✗ per database) is printed; exits non-zero on
  any failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 11:07:30 +00:00
bd1a664caa Measurement form based on select-styled <details> 2026-01-31 17:22:09 +01:00
1cddc794d2 Cleanup Quantity :pathname related code 2025-03-23 13:11:14 +01:00
4c867daabb Patch ActiveRecord with PR 54658 2025-03-22 14:14:42 +01:00
3788f1a749 Fix db:seed:export task
* replace variable names with Hash to avoid invalid Ruby identifiers
* export all values as single-quoted to avoid string interpolation and
  treating BigDecimal numbers as Float
* #truncate table instead of #delete_all to avoid foreing_key
  constraints errors

Closes #56
2025-01-05 21:05:47 +01:00
d726e92445 Allow opening multiple new/edit forms
Closes #30
2024-12-21 17:52:45 +01:00
15a5515c99 Extend NumericalityValidator to check precision and scale
Use new checks on Unit.multiplier
Closes #28
2024-12-07 20:41:19 +01:00
25ac126df9 Systematize core extesions 2024-12-07 16:05:07 +01:00
7e5f873cde Change helper into BigDecimal method 2024-12-06 15:24:25 +01:00
2e4eb3d4b5 Rake task to export default settings as seeds 2024-12-06 01:17:05 +01:00
69db87f9c6 Include date/time and seed in screenshot filename 2024-02-14 01:50:47 +01:00
0620d18391 Remove default BigDecimal formatting 2023-07-06 18:36:23 +02:00
a4745c9cb8 Add Units 2023-07-06 18:34:16 +02:00
6d2d12a9da rails new
THOR_MERGE=vimdiff bundle exec rails new -d mysql --skip-action-mailbox
  --skip-action-text --skip-active-job --skip-active-storage
  --skip-action-cable --skip-hotwire --skip-jbuilder --skip-bootsnap
  --skip-bundle .
2023-03-05 19:23:29 +01:00