Commit Graph

1091 Commits

Author SHA1 Message Date
German Galia
9ce524e1f3 Create tracker rol 2019-06-12 16:23:40 +02:00
German Galia
16ffa2a259 Add change log in investment participatory budget 2019-06-12 13:06:20 +02:00
Raimond Garcia
259e05c3e0 Merge pull request #3410 from LextrendIT/report_generation
Report generation, download CSV
2019-06-12 11:45:59 +02:00
German Galia
9d1ca3bfd4 Report generation. Download csv 2019-06-12 10:17:31 +02:00
lalo
c2860dda0e Add can_comment and can_edit_dossier abilities to valuators 2019-06-11 16:24:02 +02:00
Javi Martín
ff82e3f4e8 Remove question from legislation people proposal
It was added by accident; this field had already been removed from
legislation proposal.
2019-06-07 18:55:29 +02:00
Javi Martín
2a6c285257 Update migrations and schema file
It looks like they got out of sync when rebasing.
2019-06-07 17:36:22 +02:00
lalo
46e5d6a9fa Create Legislation::PeopleProposal model 2019-06-06 17:22:49 +02:00
Javi Martín
69c6cd6737 Fix indentation in schema file 2019-06-06 16:20:27 +02:00
lalo
d0e1eff532 Add description field to administrator users like evaluators description 2019-06-05 16:18:12 +02:00
Javi Martín
ff21ce7665 Use translations for official level names seeds 2019-05-31 19:30:14 +02:00
Javi Martín
3db1acf73d Simplify dev seed settings code 2019-05-31 19:30:14 +02:00
Javi Martín
ced0409270 Reuse default settings in dev seeds 2019-05-31 19:30:14 +02:00
Javi Martín
7830d90d4a Extract method to reset default settings 2019-05-31 19:28:50 +02:00
Javi Martín
bac0004fed Move default settings to Settings model 2019-05-31 19:28:35 +02:00
Javi Martín
19245efc93 Simplify code seeding settings 2019-05-31 19:28:13 +02:00
Javi Martín
bf6cadd137 Remove redundant comments
Commenting things like "proposal_code_prefix" represents the "Prefix
for the Proposal codes" is unnecessary.
2019-05-31 19:27:30 +02:00
voodoorai2000
7218d80297 Update migrations for Rails 5 conventions 2019-05-31 18:23:03 +02:00
voodoorai2000
4f9f9a065a Update schema.rb 2019-05-31 18:23:03 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
voodoorai2000
24dde9c35e Delete valuation 2019-05-31 15:43:06 +02:00
Julian Nicolas Herrero
3ba7bd1cab Merge pull request #3567 from consul/select_proposals_by_admins
Make proposals to be selected by administrators
2019-05-31 15:30:39 +02:00
Javi Martín
24236e654c Fix column order in schema file
When introducing Rails 5 and the dashboard, we generated the schema file
without dropping the database first. When doing so locally, migrations
aren't always executed in order, changing the order of the columns.
2019-05-29 20:49:29 +02:00
Julian Herrero
9948804e21 Add selected attribute to proposals 2019-05-29 16:51:27 +02:00
Javi Martín
8f69399799 Add version to migration files
These migrations were backported after upgrading to Rails 5.
2019-05-28 16:40:52 +02:00
Javi Martín
45a3d8daf0 Add option to enable advanced stats 2019-05-22 11:50:03 +02:00
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
Javier Martín
82e3c41aa9 Merge pull request #3512 from consul/backport-stats
Change stats layout
2019-05-21 17:18:47 +02:00
Javi Martín
7c0e499eee Add table to store stats versions
We need a way to manually expire the cache for a budget or poll without
expiring the cache of every budget or poll.

Using the `updated_at` column would be dangerous because most of the
times we update a budget or a poll, we don't need to regenerate their
stats.

We've considered adding a `stats_updated_at` column to each of these
tables. However, in that case we would also need to add a similar column
in the future to every process type whose stats we want to generate.
2019-05-21 13:50:19 +02:00
Javier Martín
cbfa2c1df8 Merge pull request #3504 from consul/backport-poll_slugs
Add slug to polls
2019-05-21 13:42:47 +02:00
Alberto
7c79965547 Merge pull request #3397 from consul/proposals-form
Remove question and external_url fields from proposals and legislation proposals
2019-05-17 17:08:56 +02:00
Bertocq
291ae7b734 Add slug to Polls on dev seed rake 2019-05-16 23:40:50 +02:00
María Checa
e3b16230e6 Added slug to polls for named urls 2019-05-16 23:40:50 +02:00
Bertocq
63631f29a8 Add ballot_lines_count counter_cache to ballot -> ballot line relationship 2019-05-16 22:01:42 +02:00
decabeza
88852544fd Fix indentation on schema 2019-05-10 17:17:39 +02:00
voodoorai2000
19b7526421 Add document upload from admin section 2019-04-30 11:59:08 +02:00
decabeza
5bdac5c4f5 Remove question and external_url fields from legislation proposals 2019-04-30 11:35:47 +02:00
decabeza
0995480b73 Remove question and external_url fields from proposals 2019-04-30 11:35:47 +02:00
Javi Martín
c43b0fea64 Use Rails 5 conventions in Dashboard
These models and migrations were added on a branch based on Rails 4.
2019-04-29 13:08:43 -05:00
voodoorai2000
e139057001 Disable dashboard email deliveries
We have to doble check all emails deliveries from the dashboard.

Using a setting to skip all dashboard email deliveries for now.

Note that a rake task to activated the `Setting["dashboard.emails"]` will need to be addded when we want to activate deliveries of these emails.
2019-04-29 15:43:46 +02:00
decabeza
51ced318e0 Merge branch 'master' into proposal-dashboard 2019-04-29 13:48:23 +02:00
Javi Martín
4b1cbb7db6 Use Rails 5 conventions in ballot migrations
These migrations and models were added after the Rails 5 branch was
created but before it was merged.
2019-04-24 19:24:01 +02:00
decabeza
4100bf2ddf Update dashboard specs 2019-04-24 14:00:38 +02:00
decabeza
2cff3767c1 Remove open in new tab option for links 2019-04-24 13:58:13 +02:00
decabeza
14d85406c3 Fix merge conflicts 2019-04-23 23:38:08 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
Julian Herrero
58b9899406 Require conflicting dependencies
spec/lib/tasks/dev_seed_spec.rb:8
This test was failing and we could see messages like:

db/dev_seeds/polls.rb:147:
warning: toplevel constant Answer referenced by Poll::Answer

Resulting in the error:

rake db:dev_seed seeds the database without errors
  Failure/Error: expect { run_rake_task }.not_to raise_error
    expected no Exception, got #<ActiveModel::UnknownAttributeError:
    unknown attribute 'question_id' for Answer

Apparently the lookup was not correclty being performed, due to
conflicting names.

"Naming conflicts of this kind are rare in practice, but if one
occurs, require_dependency provides a solution by ensuring that
the constant needed to trigger the heuristic is defined in the
conflicting place."

https://guides.rubyonrails.org/v5.0/autoloading_and_reloading_constants.html
2019-04-17 17:40:57 +02:00
Julian Herrero
65c30c8d2d Remove migrations warning
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration
is deprecated. Please specify the Rails release the migration was
written for:

class MigrationClass < ActiveRecord::Migration[4.2]

(called from require at bin/rails:4)
2019-04-17 17:40:56 +02:00
Julian Herrero
5486835661 Regenerate DB schema 2019-04-17 17:40:56 +02:00
Angel Perez
385784d09d Fix failing migrations when running rake db:migrate task
This patch adds 2 missing colons (:) for 2 migrations that are failing when
the `rake db:migrate` task is ran. Whilst already-committed-to-source-control-
and-ran-on-production-environments migrations shouldn't be modified whatsoever,
this change does not modify in any way the current database schema so, technically,
it shouldn't affect forks that might have ran these migrations already and those
CONSUL installations that haven't done so should be able to without problems
2019-04-17 17:40:56 +02:00