Commit Graph

85 Commits

Author SHA1 Message Date
taitus
b115c3af49 Rake task for create basic templates with actions and resources by default. 2019-03-21 12:29:30 +01:00
taitus
5177adb32a New rake task for proposals to send new action email
Execute rake task every day to detect new actions available for not archived proposals. If there are new actions available for today, send email to proposal's author with information text, new actions available and link to proposal dashboard url.
2019-03-21 12:29:28 +01:00
Julian Herrero
e04fd74cf1 Add rake task to rename existing setting keys 2019-03-19 19:45:34 +01:00
Julian Herrero
87be6f302c Add default site customization pages
From now on these static pages:

`/privacy'
`/conditions'
`/accesibility'
`/help/faq'
`/welcome'

have been moved to the DB and can be modified easily by any
administrator in `/admin/site_customization/pages'
2019-03-14 18:35:51 +01:00
decabeza
cfad56b872 Add rake to remove deprecated settings 2019-03-13 15:39:58 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javier Martín
4f9ca04a84 Merge pull request #3057 from consul/backport-make-milestones-polymorphic
[Backport] Make milestones polymorphic
2018-12-05 12:12:04 +01:00
decabeza
04e3bf5797 Removes references to deleted general terms page 2018-12-04 17:25:34 +01:00
Javi Martín
85ac4e6c22 Use Date.current instead of Date.today
Using `Date.today` was making the spec fail around midnight.
2018-11-30 16:04:40 +01:00
Javi Martín
d3882df437 Fix milestones migration not updating ID sequence
When we insert a record in PostgreSQL and we specify the ID, the
internal ID sequence for that table isn't updated.

In order to keep the original IDs so we didn't break any foreign keys,
we specified the IDs when copying the table, resulting in a table having
its ID sequence with a value of an existing record. When trying to
insert a new record, we got a `PG::UniqueViolation` exception.

Updating the sequence after the data migration might not be the most
elegant solution, but it's easy to do and it's already been tested on a
production environment.
2018-11-30 14:15:21 +01:00
Javi Martín
87b073cbca Migrate milestones images and documents 2018-11-30 14:15:21 +01:00
Javi Martín
1a5b73a0bd Don't load tasks several times in specs
Calling `load_tasks` in several files made rails load the tasks several
times, and so they were executed several times when called.

Since the milestone migration can't be executed twice in a row (it would
fail with duplicated ID records), loading the tasks several times made
the milestone migrations task specs fail.
2018-11-30 14:15:21 +01:00
Marko Lovic
4c3dadf1fb Add Rake task to migrate milestone data to new tables 2018-11-30 14:15:21 +01:00
Marko Lovic
c0f6fa182f Make Milestones general, and not specific to Budget Investments
Generalize the Budget::Investment::Milestone model to a
polymorphic Milestone model so it can be used for entities
other than Budget::Investment.
2018-11-30 14:15:21 +01:00
Javi Martín
9404cb8b3a Fix bug with non-underscored locales
Ruby can't have hyphens in method names, so sending something like
`record.title_pt-BR` would raise an exception.

Using globalize's `localized_attr_name_for` method fixes the bug.

Thanks Marko for the tip.
2018-10-23 16:29:14 +02:00
Javi Martín
934bce5932 Don't abort the migration if the simulation fails
We think aborting the migration will generate more headaches to system
administrators, who will have to manually check and fix every invalid
record before anything can be migrated.
2018-10-23 16:29:14 +02:00
Javi Martín
7fff57a25f Add task to simulate data migration
This way we can check everything is OK before actually migrating the
data to the translations tables.
2018-10-23 16:29:14 +02:00
Javi Martín
a84a0f2b7d Migrate custom pages data to their locale 2018-10-23 16:29:13 +02:00
Javi Martín
ef7be4fc55 Add task to migrate data to translation tables
We forgot to do it when we created the translation tables, and so now we
need to make sure we don't overwrite existing translations.
2018-10-23 16:29:13 +02:00
Bertocq
fcdc24a78c Avoid db:dev_seed log print when run from its test
The db:dev_seed rake logs info as it progresses as information for the
developer. But that's not needed when ran from its tests file, and it
bloats the travis/rspec output with unnecessary information.

Now the task will always log info unless the rake task receives an
optional argument.
2018-04-14 20:28:43 +02:00
Angel Perez
80b77e873e Add missing require for dev_seeds rake task spec 2018-03-06 18:47:57 -04:00
BertoCQ
38b66e8c6c Merge pull request #2295 from wairbut-m2c/aperez-mappable-objects
Improvements for Mappable objects
2018-02-02 19:26:47 +01:00
decabeza
286371c9d9 Changes more_info folder and path to help 2018-01-30 18:26:30 +01:00
Angel Perez
665a5b57ab Empty instances of MapLocation won't result in a new DB record (#2220) 2018-01-26 09:26:48 -04:00
rgarcia
e456f5fc1c Remove duplicate dev_seed execution 2018-01-22 17:40:56 +01:00
Bertocq
34bb9d65b1 Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
2018-01-07 17:39:48 +01:00
Bertocq
3509bfe3e4 Remove spending proposals from sitemap and its test, deprecated model 2018-01-07 15:38:44 +01:00
BertoCQ
abfa203f5c Merge pull request #2249 from wairbut-m2c/aperez-sitemap-specs
Specs for valid sitemap generation
2018-01-07 11:24:43 +01:00
Bertocq
ed16a78f42 Enables RSpec/ExampleWording and fixes all issues
Both avoiding 'should' and repiting 'it' on the tests description
improves reading them and also makes all descriptions consistent.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
2018-01-07 01:03:45 +01:00
Bertocq
de2816a6a5 Enable RSpec/BeforeAfterAll rule and fix all issues
This cop tries to avoid state leaking between examples. The fixes done on the code don't follow the suggested path, since the usage of `before(:all)` was not really useful. By using RSpec's `let` method we achieve same goals but with much better and readable tests.

Check Cop description at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
2018-01-06 21:16:00 +01:00
Angel Perez
6107f51b19 Add specs for valid sitemap generation (#2219) 2018-01-05 15:16:41 -04:00
Angel Perez
cd8d1706f9 Add spec for 'rake db:dev_seed' task 2017-12-18 08:59:39 -04:00
Bertocq
e4e78c8f16 Rubocop autocorrections 2017-09-14 15:08:35 +02:00
taitus
56eb30cc87 Add associate community rake task. 2017-09-05 12:55:12 +02:00
Bertocq
8b063a1bc1 Create spec for the new settings migration rake task 2017-06-07 20:56:49 +02:00