Commit Graph

9 Commits

Author SHA1 Message Date
Javi Martín
efc46fe6c8 Add Performance/StringIdentifierArgument rule
It was added in rubocop-performance 1.13.0. We were already applying it
in most places.

We aren't adding it for performance reasons but in order to make the
code more consistent.
2023-01-11 16:05:20 +01:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
93a2ebd46f Add and apply DuplicateMethods rubocop rule
These methods were defined with `attr_reader` (or accessor in some
cases) and then they were redefined.
2019-10-05 15:03:26 +02:00
Javi Martín
7b5ce80593 Simplify MergedCommentTree#initialize
By setting the comments lazily in a different method, we can share its
code with the parent class.
2019-05-29 20:50:53 +02:00
Julian Herrero
002e16ce30 Use double quotes in lib/ 2019-03-15 10:29:07 +01:00
Bertocq
dff966d9b3 Show valuation comment thread @ Valuation show/edit
Why:

Budget Investment's valuators should be able to see internal valuation
comments thread at both show and edit views.

How:

At Valuation::BudgetInvestmentsController:
* Include CommentableActions to gain access to the entire feature, with
required resource_model & resource_name methods.
* Add the only possible order (oldest to newest)
* Load comments on both show & edit actions, passing `valuations` flag
to the CommentTree in order to only list those.

At CommentTree:
* Use `valuations` flag as instance variable to decide wich
comment threat to load: valuations (if relation exists) or comments.
2018-01-31 01:53:33 +01:00
rgarcia
35704f2be9 refactors comment tree 2016-01-07 15:18:45 +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
60b3c65b05 Refactor comment tree calculation using a PORO 2015-10-30 17:00:32 +01:00