Commit Graph

2781 Commits

Author SHA1 Message Date
Senén Rodero Rodríguez
a2130689ed Create documentable concern and add it to budget investment model. Create documents controller, documents helper, routes, translations and specs 2017-08-25 17:27:37 +02:00
Senén Rodero Rodríguez
c92827e89e Add abilities to documentable authors and admins to create and destroy documents. 2017-08-25 17:27:37 +02:00
Senén Rodero Rodríguez
34d06dad04 Add document model validations and model shared specs. 2017-08-25 17:27:37 +02:00
Senén Rodero Rodríguez
a141c82e33 Create new polymorphic model Document. 2017-08-25 17:27:37 +02:00
rgarcia
456429f08b adds shifts 2017-08-04 21:27:30 +02:00
taitus
edbbe6174b Refactor specs because now recommendations only return results asociated to user interests 2017-08-03 00:23:06 +02:00
rgarcia
43b636de09 avoids postgres exception regarding subquery limits
We have apparently reached a postgres limit for the number of
attributes we query. Using ids instead of the proposal objects seems to
fix it

Using `Array` and `map` instead of `pluck`, because the proposals
attribute can be a single object
2017-08-02 21:34:40 +02:00
rgarcia
113d8a0f28 minor refactoring for proposal recommendations 2017-08-02 20:27:20 +02:00
taitus
9ef6478e67 Problem with disinct 2017-08-02 18:41:00 +02:00
taitus
b412f8a88c Avoid duplicate proposals with group on query. Avoid show successful proposals on recommendations. 2017-08-02 14:31:02 +02:00
taitus
7afacf3a2f Force distinct to recommendations methods. Sort by recommendations on home carousel. 2017-08-02 12:52:55 +02:00
taitus
28aaa584e9 Fix proposal refactor. 2017-08-02 12:32:42 +02:00
taitus
52e3610876 Minimum required by consul core. Remove comments. Fix texts. Decrease size of methods. 2017-08-02 00:15:03 +02:00
taitus
5f1bdb2f94 Rename recommendeds to recommendations 2017-08-01 16:31:45 +02:00
taitus
dc5584086a Styles for filters. Refactor commentable action. 2017-08-01 16:31:45 +02:00
taitus
fe3bb7a389 Add recommended tab on proposals and debates index. 2017-08-01 16:31:44 +02:00
taitus
c6a9ffc19c Remove recommended investments 2017-08-01 16:28:01 +02:00
taitus
9aeb5eb758 Always display results when user has interests. 2017-08-01 16:28:01 +02:00
Senén Rodero Rodríguez
3068224a50 Add scope to followable concern to get all followable object followed by given user. 2017-08-01 16:28:01 +02:00
taitus
56511a154a Add feature and model specs. 2017-08-01 16:28:01 +02:00
taitus
36c76996e3 Display proposals and debates recommended when user have not interests. 2017-08-01 16:28:01 +02:00
taitus
e82e8f5787 Do not show proposals and investments as recommended when already followed 2017-08-01 16:28:01 +02:00
taitus
ff6471982c Add recommended debates, proposals and investement to Home page. 2017-08-01 15:48:21 +02:00
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