Files
nairobi/spec/models
Javi Martín 354b183e17 Create reports
This table will store which reports (stats, results, ...) will be shown
for a certain process (polls, budgets, ...).

Note Rails fails to save a poll and its report when both are new records
if we add a `validate :process, presence: true` rule. Since it caused a
lot of trouble when creating records for tests during factories rule
completely. Instead, I've created the `results_enabled=` and
`stats_enabled=` methods, so tests are easier to set up, while also
automatically creating a report if it doesn't already exist. This also
decouples form structure and database implemenation.

Originally I named this table `enabled_reports` and instead of having
`stats` and `results` columns, it had an `enabled` column and a `kind`
column, which would be set to "stats" or "results". However, although
that table would allow us to add arbitrary reports easily, I found the
way we had to handle the `has_many` relationship was a bit too complex.
2019-05-22 11:50:03 +02:00
..
2019-03-27 15:22:14 +01:00
2019-05-21 13:50:19 +02:00
2019-05-22 11:50:03 +02:00
2019-03-27 15:22:14 +01:00
2019-04-17 17:40:56 +02:00
2019-05-22 11:50:03 +02:00
2019-04-17 17:40:56 +02:00
2019-04-30 12:00:54 +02:00
2019-03-27 15:22:14 +01:00
2019-01-18 14:17:12 +01:00
2019-03-19 15:14:08 +01:00
2019-02-05 17:41:00 +01:00
2019-02-12 17:19:36 +01:00