Commit Graph

98 Commits

Author SHA1 Message Date
Juanjo Bazán
b7d9ef6377 models inherits from ApplicationRecord 2019-04-17 17:40:56 +02:00
rgarcia
7e3eb4a6fc fixes expire cache specs 2019-04-16 17:28:07 +02:00
Julian Herrero
3ba961a2d7 Use double quotes in models 2019-03-14 17:25:43 +01:00
Bertocq
26cf91c61a Create valuation comments creation ability
Why:

Only admins or valuators (for those investments they've assigned) can
create internal valuation comments on them.

How:

* Creating a new `comment_valuation` ability for admins and valuators in
the same manner the `valuate` ability works.

* Adding a validation at Comment model for those with `valuation` flag
active that checks if the author can make a valuation comment on the
commentable, as well as the respective active record error messages.
This will prevent comments from being created at a controller level as
well.

* Improving comment factory trait `valuation` to have an associated
investment, author that is a valuator and setting the valuator on the
valuators list of the investment
2018-01-31 02:03:03 +01:00
Bertocq
149c81371b Allow valuation internal comments to be created
How:

Using a local variable at partials to set a hidden true/false value for
`valuation` parameter on the comment creation form.

Allowing that new param at the comment controller and using it when
building a new Comment.
2018-01-31 02:03:02 +01:00
Bertocq
56fc5c9583 Filter internal valuation comments from public api
Why:

Internal valuation comments are only for admins and valuators,
not for the public view.

How:

Adding a `not_valuations` scope and use it at the `public_for_api` one
2018-01-30 19:22:27 +01:00
Bertocq
070c94494e Fix linelenght over 100 on multiple files 2018-01-26 00:27:03 +01:00
rgarcia
2b52d26d82 refactors notifications into concerns and shared examples 2017-12-14 16:15:30 +01:00
Juanjo Bazán
21b2a11339 adds poll comments to API 2017-11-21 14:31:03 +01:00
decabeza
f0cfe50de4 Merge branch 'master' into 1856-legislation_processes_proposals_phase 2017-10-25 11:52:31 +02:00
Manuel Lucena
63cbe2f7c1 20171003 - [WIP] Functionality and tests for polls comments 2017-10-06 10:36:26 +02:00
María Checa
57c48fe596 Legislation proposals comments working 2017-09-21 17:13:12 +02:00
taitus
bea393bcde Add comments to topics 2017-09-05 12:51:08 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Bertocq
2888c20489 Fix all Style/RedundantSelf rubocop issues 2017-07-05 11:55:52 +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
Bertocq
d7b8777395 Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list 2017-06-26 18:03:40 +02:00
Bertocq
8d84ed712a Fix all Rails/Validation rubocop issues and remove files from rubocop_todo list 2017-06-25 15:46:46 +02:00
kikito
0ad1ff5845 changes the way public_for_api is calculated in comment 2017-06-13 12:11:20 +02:00
kikito
1701111bf5 Merge branch 'api-dev-PRs' of https://github.com/amiedes/consul into amiedes-api-dev-PRs-2 2017-06-13 12:07:28 +02:00
Alberto Miedes Garcés
9ec8b166d7 Use scopes for better query performance 2017-06-01 20:04:51 +02:00
decabeza
5e0d5fc8c3 Merge branch 'legislation-module-stable' of https://github.com/medialab-prado/consul into medialab-legislation 2017-05-22 18:43:49 +02:00
Alberto Miedes Garcés
5d9054d284 Merge branch 'master' into api-dev-PRs
Conflicts:
	Gemfile.lock
	config/routes.rb
	db/dev_seeds.rb
	db/schema.rb
2017-05-11 21:59:42 +02:00
Alberto Miedes Garcés
6b47ce065f Fix buggy associations 2017-01-27 14:27:28 +01:00
Alberto Miedes Garcés
5b7cbccd19 Merge branch 'master' into api-dev 2017-01-26 12:39:59 +01:00
Alberto Miedes Garcés
83267330a7 Group methods related to text generation for GraphQL documentation into a module 2017-01-26 10:47:12 +01:00
Alberto Miedes Garcés
e3fca5c49f Remove functionality related to votes demographic info
Since this was giving me too much pain and nobody actually requested
this functionality, I decided to remove it.
2017-01-25 13:37:29 +01:00
Juanjo Bazán
113f9b32d7 Merge branch 'master' into polls 2017-01-19 16:51:19 +01:00
Alberto Miedes Garcés
d1f14ffb93 Simplify the way GraphQL 'resolve' is used 2017-01-12 19:51:58 +01:00
Amaia Castro
a2a61341fe Merge branch 'master' into legislation-module-stable 2017-01-11 22:54:41 +01:00
Juanjo Bazán
f102f9f753 adds Budget::Investment to valid commentable types 2017-01-10 13:30:30 +01:00
Alberto Miedes Garcés
6940b90260 Add more fields to api.yml 2017-01-09 14:11:51 +01:00
Amaia Castro
b8f034d896 Legislation annotations/comments page 2017-01-09 09:29:15 +01:00
Alberto Miedes Garcés
861a723724 Only show public_voter if votable.total_votes are above threshold 2017-01-07 17:22:18 +01:00
Alberto Miedes Garcés
9c6001e987 Move public_author into module 2017-01-01 20:46:08 +01:00
Juanjo Bazán
5ec12e4b5b Merge branch 'master' into redux-polling 2016-12-27 18:22:06 +01:00
Alberto Miedes Garcés
90ff84b6ef Update API fields for Comment 2016-12-27 18:18:22 +01:00
Amaia Castro
d25d6c178c Legislation Questions model and basic admin 2016-12-20 18:52:43 +01:00
rgarcia
b104859da3 adds question comments 2016-11-16 19:41:52 +01:00
rgarcia
bb3c4c6399 adds consistency to ruby code style
Keep a blank line before and after private
Keep a blank line before and after protected
Remove extra empty line at class body end
Remove extra blank line
Add final newline
Use 2 (not 3) spaces for indentation
Use 2 (not 4) spaces for indentation
Remove space before comma
Add space after comma
Remove trailing whitespaces
Remove unnecessary spacing
Use snake_case for variable names
Do not use then for multi-line if
Remove unused block argument - i
Use the new Ruby 1.9 hash syntax
Remove unused assignment to variable
Indent when as deep as case
Align attributes
Align end with def
2016-11-15 11:18:43 +01:00
palomahnhp
d786f9edea adds the maximum length of the comments to settings 2016-03-03 15:20:29 +01:00
Juanjo Bazán
c258a4f3b4 adds scope for only normal user comments 2015-11-12 12:15:36 +01:00
kikito
73c306a673 Adds 3 orders for comments: most_voted, newest, oldest 2015-11-02 14:01:55 +01:00
kikito
0cf592af71 Fixes two issues in comment_tree
* The descendants list for a comment was not being built correctly
* The root comments must be ordered “newest first”, but their
descendants must be ordered “newest last”
2015-10-30 20:06:36 +01:00
kikito
a7daf0108b sorts comments by creation date after sorting by confidence_score 2015-10-28 17:34:02 +01:00
kikito
f5d9ea4357 adds confidence_score capacity to the comment model 2015-10-28 16:25:35 +01:00
Juanjo Bazán
b979f871dd removes unused method 2015-09-24 12:42:21 +02:00
Juanjo Bazán
23eba622a2 fix bug when blocking users 2015-09-22 16:30:43 +02:00
kikito
343025872b changes comment moderation to be similar to proposals moderation 2015-09-22 14:20:37 +02:00
kikito
793bc52d00 recalculates comments_count when restoring in addition to when hiding a comment 2015-09-18 11:00:18 +02:00