Commit Graph

1158 Commits

Author SHA1 Message Date
Bertocq
7d406cae76 Rubocop autocorrections 2017-07-25 13:01:03 +02:00
BertoCQ
13871b823b Merge pull request #1750 from rockandror/followable-user-activity
User page: new following section
2017-07-24 13:10:09 +02:00
Bertocq
361e0efe00 Remove Poll Recount model and all usages 2017-07-23 23:29:24 +02:00
BertoCQ
3668024d83 Merge pull request #1752 from MariaCheca/1725-census_local_copy_user_verification
Allow users to verify their account against a local copy of the Census
2017-07-21 11:36:29 +02:00
Senén Rodero Rodríguez
b7bce2e699 Remove complex methods from follow model. Create instance method followed_by? on followable model concern. Some code improvements. 2017-07-19 21:50:37 +02:00
María Checa
0c84619cef Recovered LocalCensusRecord model validations 2017-07-19 19:49:16 +02:00
María Checa
1aeb068cb2 Naming minor fix 2017-07-18 13:07:30 +02:00
decabeza
2844c03e43 adds consistency on social media filenames 2017-07-18 11:40:19 +02:00
María Checa
d576fd5951 Merge branch 'master' into 1725-census_local_copy_user_verification 2017-07-14 15:50:26 +02:00
María Checa
6a24288bed Removed local_census_record association in User 2017-07-14 15:35:11 +02:00
María Checa
77b8d93893 Removed unnecessary validation in LocalCensusRecord 2017-07-14 15:34:31 +02:00
taitus
b0c571e658 Do not display send notification button when proposal is from another author. 2017-07-13 20:33:57 +02:00
María Checa
ee1d418e2b Removed user_id column from local_census_records table
That attribute is not necessary as `Verification::Residence` model is in charge of verifying user document uniqueness.
2017-07-13 13:09:48 +02:00
BertoCQ
8d7a467397 Merge pull request #1746 from consul/rubocop/rails_fixes
Rubocop fixes 🤖: Rails edition 💎🛤
2017-07-11 22:28:55 +02:00
BertoCQ
9c4eb4cef3 Merge pull request #1727 from rockandror/followable
Followable
2017-07-11 13:19:42 +02:00
Bertocq
fafec293e8 Remove duplicated ability for everyone 2017-07-11 12:51:39 +02:00
BertoCQ
204ea13c85 Merge branch 'master' into followable 2017-07-11 11:30:49 +02:00
Senén Rodero Rodríguez
b0ee52556c Remove comment 2017-07-11 10:36:07 +02:00
Bertocq
beb4bc119c Fix Rails/Delegate rubocop issue 2017-07-10 23:02:27 +02:00
Bertocq
efacd0def3 Make calculate_winners explicitly delayed
Why:

* As seen on preproduction and production environments on Madrid's fork. Budget::Result#calculate_winners is very costly when done to all headings for a given budget (as requested on Admin::BudgetsController#calculate_winners) but its not when done individually for only a heading (as requested on Budget::Investment#recalculate_heading_winners)

How:

* Removing `handle_asynchronously :calculate_winners` from bellow Budget::Result#calculate_winners definition, to avoid making any call delayed. And explicitly calling `.delay` only when needed (on Admin::BudgetsController#calculate_winners)
2017-07-10 15:12:14 +02:00
Bertocq
2b85deabec Recalculate heading winners on incompatibility change
Why:

* We should recalculate winners also when an incompatible investment is flagged as compatible again

How:

* Removing the condition to recalculate that was checking only for a winner investment flagged as incompatible
* Extending the Budget::Result model spec to cover that new scenario
2017-07-10 14:24:55 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
María Checa
089c690b49 Created new entry point CensusCaller
Here's a better alternative than the first one. Added a new abstraction level from which are performed both types of census calls, while the logic of those is managed in their own library.
2017-07-10 12:22:30 +02:00
María Checa
7e701db608 Added new census data source to Verification::Residence
Adapted model to perform a query to find a `LocalCensusRecord` record in case the census API is not available or returns invalid data.
2017-07-08 20:39:05 +02:00
María Checa
feff9fff0f LocalCensus model created 2017-07-08 19:56:10 +02:00
Senén Rodero Rodríguez
4b2310c135 Move and refactor method from follow to user model to get user interests. Add specification to check the discard of duplicate interests. 2017-07-07 15:18:34 +02:00
taitus
5fe894aa6b New proposal method to get users_to_notify. 2017-07-07 13:38:52 +02:00
taitus
b60748c552 Remove unneeded return from Follow model. Add whitespaces to enhance reading. 2017-07-07 13:38:52 +02:00
taitus
b29bf62f56 Send proposals notifications to followers. 2017-07-07 13:37:55 +02:00
taitus
35f7f11177 Add dependent destroy to followable. 2017-07-07 13:37:55 +02:00
taitus
14ec4f5315 Add styles and translations for users interests. 2017-07-07 13:37:53 +02:00
taitus
19820e4432 Add public interests validation and show interests on user profile 2017-07-07 13:34:43 +02:00
taitus
bce28afe36 Add followable to budget investment model. 2017-07-07 12:07:25 +02:00
Senén Rodero Rodríguez
84dbef16a4 Create followable concern, follow model. Add followable to proposal model. 2017-07-07 12:02:00 +02:00
BertoCQ
e990568895 Merge pull request #1721 from consul/feature/add_slugs_to_budget_related
Add slugs to budget related
2017-07-05 13:16:24 +02:00
Bertocq
e3d89261a6 Add Sluggable concern and unique validation to Budget, Group and Heading
* What: We need to generate slug on Budget, Group and Heading classes, validating its unique for its scope

* How: Adding a presence and unique validation using Budget always as scope.
2017-07-05 12:33:16 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
97d7a21791 Fix all Style/RedundantReturn rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
28970c6701 Fix all Style/UnneededInterpolation rubocop issues and remove from rubocop_tod 2017-07-04 22:44:08 +02:00
Bertocq
4535fc9345 Create Sluggable concern, generates slug using name attribute before validation
Why:

* We need a way to generate a slug for a object given his name attribute value

How:

* A concern that generates the slug before validation
2017-07-04 18:40:54 +02:00
Bertocq
9f38192e13 Remove unnecesary frozen_string_literal comment 2017-07-04 17:25:15 +02:00
Raimond Garcia
e7e5b3c4a3 Merge branch 'master' into 1647-locale_site_customization 2017-07-04 12:11:07 +02:00
Bertocq
339597483e Add incompatible scope to Budget Investment model 2017-07-04 01:34:25 +02:00
Bertocq
99052485fb Recalculate heading winner investments when a winner is flagged as incompatible 2017-07-04 01:34:24 +02:00
Bertocq
640e0e1c2a Use compatible filter when calculating budget heading winners 2017-07-04 01:34:24 +02:00
Bertocq
ed016d7afd Add compatible scope to Budget Investment and use it on the winners scope
Why:

* Only compatible investments can be winners

How:

* Using the new column incompatible to filter compatible investments
2017-07-04 01:34:24 +02:00
María Checa
36d51b380b Merge branch 'master' into 1647-locale_site_customization 2017-07-02 23:19:40 +02:00
María Checa
8894ec4f7c Pages form improvements
Added `locale` validation to model and improved its form select tag performance.
2017-07-02 21:28:13 +02:00
María Checa
ed7b7f0361 Added scope to pages model
New scope to use when listing pages to show only the ones with current locale.
2017-07-02 14:54:11 +02:00
Eduardo Martinez Echevarria
a599a0b91e Set legislation processes visibility depending on publication 2017-06-30 15:08:23 +02:00