Commit Graph

217 Commits

Author SHA1 Message Date
Julian Herrero
6e88031537 Fix several rubocop warnings
Metrics/LineLength: Line is too long.
RSpec/InstanceVariable: Use let instead of an instance variable.
Layout/TrailingBlankLines: Final newline missing.
Style/StringLiterals: Prefer double-quoted strings.
2019-04-17 17:40:56 +02:00
Juanjo Bazán
b7d9ef6377 models inherits from ApplicationRecord 2019-04-17 17:40:56 +02:00
taitus
638c80760f Fix queries and scopes after column deletion
Some queries were accessing original column instead of the new translatable one. This should have been causing unexpected behavior for requests maded in a different locale than the application default.
2019-04-17 17:40:56 +02:00
rgarcia
c979cc7411 Fix uniq deprecation warning
DEPRECATION WARNING: uniq is deprecated and will be removed from Rails
5.1 (use distinct instead) (called from block in <class:User> at
/home/travis/build/consul/consul/app/models/user.rb:67)
2019-04-16 17:28:07 +02:00
alejandro
84338592da removes devise-async for delayed devise emails
Custom overwrite of the devise implementation following
https://github.com/plataformatec/devise#activejob-integration
2019-04-16 17:28:07 +02:00
Javi Martín
4c35df4812 Use double quotes inside string interpolation 2019-03-25 14:58:54 +01:00
Julian Herrero
3ba961a2d7 Use double quotes in models 2019-03-14 17:25:43 +01:00
decabeza
73a0f999ad Add order to voted headings names 2019-02-12 17:19:36 +01:00
voodoorai2000
f4b8099703 Simplify sql query 2019-02-12 17:18:38 +01:00
Marko Lovic
264c4e747b Improve User#headings_supported_within_group performance
Performs a single DB call instead of 3
2019-02-12 17:16:49 +01:00
Marko Lovic
e47cbe2a10 Extract "supported headings" logic to User method
In preparation to use this method from views where
it doesn't make sense for it to be associated with
a specific investment.
2019-02-12 17:16:29 +01:00
Javier Martín
3b82057178 Fix admin menu not showing for some admins
There was a bug when finding the manager login, since we were only using
the last digit of their user ID.
2018-07-28 22:06:11 +02:00
Javier Martín
157cd001d5 Add spec to expose a bug finding manager logged in
I've moved the method to the User model in order to make it easier to
test. I'm not sure where it belongs, though.

There was already a failing spec in `spec/features/management_spec.rb`,
but it passed if run standalone because it only failed if previous tests
had already created nine users or more.
2018-07-28 22:03:33 +02:00
Angel Perez
7bb1da1804 Adapt backend to enable flagging/unflagging investments 2018-07-20 18:42:33 -04:00
rgarcia
f670019325 Deal gracefully with recommendations of hidden proposals
We were seeing an exceptions in the home page when displaying
recommendations. This was due to trying to load tags of hidden proposals

With this commit we are skipping proposals that that have been hidden,
which will hopefully solve this exception
2018-07-10 17:47:28 +02:00
iagirre
21b1d00205 Add backend for the moderators
Add new routes for the proposal notifications edition and
abilities to let moderators edit it (mark as ignored, hide, etc.).

The notifications are not flaggable because they doesn't work like that,
but in a similar way. The moderator/administrator is in charge of hidding
them through the UI, so the normal users don't flag it as inappropriate.

New controller Moderation::ProposalNotification to manage the moderators
work.
2018-07-02 18:17:45 +02:00
Raúl Fuentes
376ce443ef Add logic to user verification
changed functions on verification.rb, the first thing they do is
return true whene skip_user_verification is active.
changed show_welcome_screen? on user.rb, now its shows the welcome
page even with te option active.
changed welcome.html.erb, now if the user see this view and the
option is activated, all 4 checks are green, not only 2.
2018-05-22 15:02:35 +02:00
Bertocq
65288573b5 Fix user administrators scope relation 2018-02-22 00:42:40 +01:00
Bertocq
1434449b84 Fix line length issues at User model 2018-02-19 11:09:19 +01:00
Bertocq
9925e2b02f Extract inline query to User scope & refactor 2018-02-19 11:09:19 +01:00
Bertocq
cd66ba5d54 Rubocop autocorrections 2017-11-13 02:22:00 +01:00
María Checa
841ef2a3a2 Merge branch 'master' into 1856-legislation_processes_proposals_phase 2017-10-09 17:19:07 +02:00
María Checa
ac5620c583 Merge branch 'master' into 1856-legislation_processes_proposals_phase 2017-09-21 21:24:56 +02:00
María Checa
ba041f90c8 Removed unnecessary parts in Legislation Proposals 2017-09-21 16:17:11 +02:00
BertoCQ
f67ba62c49 Merge branch 'master' into user-recomendations 2017-09-19 18:56:12 +02:00
María Checa
c1672bdbf4 Legislation proposals adaptation in some models and initializers 2017-09-19 10:10:10 +02:00
Bertocq
e4e78c8f16 Rubocop autocorrections 2017-09-14 15:08:35 +02:00
Raimond Garcia
2519f232ab Merge branch 'master' into user-recomendations 2017-09-05 17:15:42 +02:00
taitus
90518d4f99 Refactor participants. Add scopes on User. 2017-09-05 12:54:32 +02:00
taitus
0d76004636 Simplify and refactor method to calculate community participants 2017-09-05 12:54:32 +02:00
taitus
4539c5fa00 Refactor and tests. 2017-09-05 12:52:14 +02:00
taitus
08f58b845d Add participants to community 2017-09-05 12:51:08 +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
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
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
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
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +02:00
Bertocq
1c8e039862 Fix all Layout/SpaceInsideParens rubocop issues and remove files from rubocop_todo list 2017-06-26 18:06:01 +02:00
Bertocq
c4d90691b1 Fix all Layout/SpaceInLambdaLiteral rubocop issues and remove files from rubocop_todo list 2017-06-26 18:05:14 +02:00
Bertocq
e6dd33bd66 Fix all Layout/SpaceAfterComma issues and remove from rubocop_todo list 2017-06-26 17:57:53 +02:00
rgarcia
9ebc5ccf34 removes user locale validation 2017-06-21 13:11:59 +02:00
Juanjo Bazán
315c57929a allows managers to create users without email
allows managers to create users without email

hides email preferences from account page for email-less users

prevents email delivery to users with no email

adds spec for user creation from management

adds specs for user's email requirement

adds spec for no deliveries if no email
2017-06-19 13:02:48 +02:00