Commit Graph

186 Commits

Author SHA1 Message Date
rgarcia
ce3cb045f8 Convert random seed to a small value
We are trying out a modulus function to return investments in random
order https://github.com/consul/consul/pull/2131

However we ran into the gotcha of having a seed value too big for the
modulus function to work as expected

If the seed is bigger than the investment id, the records are returned
ordered by id

By dividing the seed by a big number, this problem seems to get fixed
2018-04-05 22:16:54 +02:00
decabeza
ef00eaa765 Adds missing content to budget investments mode view
This feature was already on Madrid fork and missing on backport
2018-04-05 14:53:22 +02:00
decabeza
2f5561bf03 Adds view mode on budget investments 2018-04-02 17:26:12 +02:00
María Checa
535a96603a Add budget/investments#json_data method 2018-03-27 15:25:55 +02:00
Raúl Fuentes
ebebbdf078 Added bigger pool for random seeds, now with a 9 * 10e-07 % of chance of appearing, also added test to cover edge cases (case in fact, the coincidence of the seeds it's correct)
Conflicts:
	app/controllers/budgets/investments_controller.rb
2018-02-08 16:33:15 +01:00
Bertocq
6e9191dc7c Budget Investment controller has no update method 2018-02-03 01:19:25 +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
María Checa
c56a7b4e16 Added related contents to budget investments 2018-01-11 16:49:07 +01:00
María Checa
5161988844 Removed external_url input 2018-01-08 23:22:46 +01:00
rgarcia
19a084c0c7 adds map validations 2017-12-19 20:32:55 +01:00
Bertocq
05a6c35b65 Switch case statement for if 2017-12-04 15:48:09 +01:00
Bertocq
b327420e72 Force setseed value range from -1 o 1 2017-12-04 15:42:59 +01:00
Bertocq
c5fa85e3f6 Prevent a division by zero from happening on sort by random investment scope 2017-11-29 11:40:10 +01:00
iagirre
87f6f14d48 Bigger random seed range. Tests added to check the randomness between browsers 2017-11-15 11:50:06 +01:00
iagirre
fbb02095bb Some fixes to new code to make the test pass 2017-11-15 09:02:19 +01:00
iagirre
7f0e447e0f One aproach to make the randomness work with kaminari 2017-11-15 08:56:31 +01:00
Senén Rodero Rodríguez
5956207a00 Add map locations. Each map location can belongs to proposal or budget investment. 2017-09-27 14:48:12 +02:00
Senén Rodero Rodríguez
f6fba64012 Remove uneeded document and image initializations 2017-09-26 13:57:14 +02:00
Senén Rodero Rodríguez
0a86727c6a Move method 'recover_image_from_cache' from imageable controllers to image. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
c22637c349 Move method 'recover_documents_from_cache' from documentable controllers to document. 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
d98d1312ca Add _destroy parameter to nested image 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
77f63a4c44 Add _destroy parameter to nested documents 2017-09-26 13:57:13 +02:00
Senén Rodero Rodríguez
6f71da07ee Duplicate documentable code and rename for imageable 2017-09-26 13:55:03 +02:00
Bertocq
614ff79ba1 WIP 2017-09-26 13:53:43 +02:00
Senén Rodero Rodríguez
7b63f01a86 Use paperclip destroy function instead of setting object to nil. 2017-09-26 13:53:43 +02:00
Senén Rodero Rodríguez
4469aa9b32 Allow to remove budget investment image from edit image page to authors and administrators. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
acc79cbe31 Add edit_image and update_image action to budget/investments controller. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
515d6d7e70 Rename image_description column to image_title on budget investments. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
673fc66011 Add budget investements images specs 2017-09-26 13:53:42 +02:00
taitus
7b88e63136 Add image to budget investments. 2017-09-26 13:53:42 +02:00
Senén Rodero Rodríguez
4081dded5f Add nested documents to new budgetinvestments. 2017-08-25 18:34:53 +02:00
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
Bertocq
705ef19f6d Improvements on budget results view & table 2017-07-17 20:19:54 +02:00
rgarcia
ffb80d8c51 Loads first heading if no heading_id params present 2017-07-13 12:29:18 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Bertocq
10c299d19f Add to public Budget Results page winners, discarded and incompatible listing 2017-07-04 01:34:25 +02:00
Raimond Garcia
22d28d9c79 Merge branch 'master' into issue#1575-tag-administration 2017-06-29 19:09:54 +02:00
Bertocq
f6fe9cc7d2 Fix all Layout/SpaceAroundOperators rubocop issues and remove file list from rubocop_todo list 2017-06-26 18:04:20 +02:00
Eduardo Martinez Echevarria
8dd52110db Use category scope instead of condition on kind on Tag 2017-06-23 17:34:55 +02:00
Raimond Garcia
58da3b43e6 Merge pull request #1638 from entantoencuanto/issue#1595-results_url_permissions
Issue#1595 results url permissions
2017-06-12 13:09:27 +02:00
Eduardo Martinez Echevarria
2380b97bd0 Make budgets result show action available only when budget is finished 2017-06-11 23:33:05 +02:00
Eduardo Martinez Echevarria
89d2793d76 Setup suggest action in investments controller 2017-06-11 14:10:29 +02:00
Eduardo Martinez Echevarria
2e67c860fd Setups in investments controller for Polymorphic concern 2017-06-11 14:10:29 +02:00
rgarcia
ed5a1cecbb adds budget results 2017-05-19 14:04:46 +02:00
Juanjo Bazán
86c37d4952 removes old commented code 2017-05-16 13:12:55 +02:00
Juanjo Bazán
3eb22ab7b9 removes exception on invalid vote
responds rendering correct error message instead
2017-05-16 13:12:32 +02:00
rgarcia
10282d67ab fixes typo 2017-05-15 11:53:01 +02:00
Raimond Garcia
aad725faf6 Merge pull request #1523 from consul/budgets-polish
Budgets polish
2017-05-06 05:08:27 +02:00
rgarcia
c0488c3b3c refactors investment filters 2017-05-06 04:57:06 +02:00
rgarcia
8e7ca16c47 makes ballot's back link point to referer 2017-05-05 20:07:24 +02:00