Commit graph

18 commits

Author SHA1 Message Date
Paul Chavard
6254b50de9
Revert "Revert "Merge pull request #10771 from tchak/refactor-champs-revert""
This reverts commit 10a1ae5534.
2024-09-23 10:21:07 +02:00
simon lehericey
10a1ae5534
Revert "Merge pull request #10771 from tchak/refactor-champs-revert"
This reverts commit c902061ebf, reversing
changes made to b4ed11c788.
2024-09-19 11:09:01 +02:00
Paul Chavard
988025ba69
refactor(champs): validate only champs in current revision 2024-09-17 10:29:34 +02:00
Colin Darie
e7443c2308
Revert "Champ related cleanups and refactoring" 2024-08-30 16:43:30 +02:00
Paul Chavard
f7cd7e615d
refactor(champs): validate only champs in current revision 2024-08-26 14:53:56 +02:00
Colin Darie
77fb0553fc
chore: enable freeze string literals by comment 2024-08-22 09:26:48 +02:00
Paul Chavard
229483d16c
refactor(champ): remove type_de_champ_id and champ factories 2024-07-22 13:53:45 +02:00
mfo
c50f949acd
feat(Champs::number*): normalize values by stripping spaces. 2024-07-04 09:56:23 +02:00
mfo
cfda807b66
fix(data): decimal number having spaces are no more exportable 2024-06-25 21:17:46 +02:00
mfo
476c7df160
bug(Champs::DecimalNumberChamp.for_export): should be able to cast a number wrapped with a string having leading/trailing spaces 2024-06-25 17:05:33 +02:00
mfo
938f5043a4
feat(champs.validation): standardize champ error messages 2024-04-12 11:39:43 +02:00
mfo
04f3b6a844
fix(Champs::DecimalNumberChamp): validates Champs::DecimalNumberChamp respecting it's validation context 2024-04-01 07:07:11 +02:00
Lisa Durand
a3ab6dd257 add validation on decimal max 3 digits after coma 2024-03-27 10:55:10 +01:00
Judith
25a24ba7c8 removal of translation keys already present in the gem rails-i18n 2020-09-01 16:33:58 +02:00
Pierre de La Morinerie
4cb747fdb6 specs: always require rails_helper
Test helpers are separated between two files: spec_helper and
rails_helper. This separation is meant to allow tests that do not
require Rails (like testing standalone libs) to boot faster.

The spec_helper file is always loaded, through `--require spec_helper`
in the `.rspec` config file. When needed, the rails_helper file is
expected to be required manually.

This is fine, but:
- Many test files have a redundant `require 'spec_helper'` line;
- Many test files should require `rails_helper`, but don't.

Not requiring `rails_helper` will cause the Rails-concerned section of
the test environment not to be configured–which may cause subtle bugs
(like the test database not being properly initialized).

Moreover, Spring loads all the Rails files on preloading anyway. So the
gains from using only `spec_helper` are thin.

To streamline this process, this commit:
- Configures `.rspec` to require `rails_helper` by default;
- Remove all manual requires to spec_helper or rails_helper.

Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
2020-03-31 12:48:32 +02:00
Pierre de La Morinerie
10065df8ce champs: put champ label in numeric fields validation messages
Replaces

> La valeur du champ doit être un nombre entier (sans chiffres après
> la virgule)

by

> La valeur du champ « Nombre de parents » doit être un nombre entier
> (sans chiffres après la virgule)
2019-07-11 15:12:48 +02:00
Paul Chavard
ca147969ab Fix number champs validation 2018-11-29 15:12:31 +01:00
Paul Chavard
45bfb2fd47 Add DecimalNumberChamp 2018-11-06 11:28:44 +01:00