Commit Graph

16 Commits

Author SHA1 Message Date
taitus
9521d87d03 Remove unneeded for_render
for_render does is including organizations and there is no need to
 render organizations on these controllers
2020-12-16 13:16:48 +01:00
Javi Martín
155da08cf0 Use a generic name for the search parameter
This way we can use it for any model.
2020-12-04 19:57:05 +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
7ca55c44e0 Apply Rails/SaveBang rubocop rule
Having exceptions is better than having silent bugs.

There are a few methods I've kept the same way they were.

The `RelatedContentScore#score_with_opposite` method is a bit peculiar:
it creates scores for both itself and the opposite related content,
which means the opposite related content will try to create the same
scores as well.

We've already got a test to check `Budget::Ballot#add_investment` when
creating a line fails ("Edge case voting a non-elegible investment").

Finally, the method `User#send_oauth_confirmation_instructions` doesn't
update the record when the email address isn't already present, leading
to the test "Try to register with the email of an already existing user,
when an unconfirmed email was provided by oauth" fo fail if we raise an
exception for an invalid user. That's because updating a user's email
doesn't update the database automatically, but instead a confirmation
email is sent.

There are also a few false positives for classes which don't have bang
methods (like the GraphQL classes) or destroying attachments.

For these reasons, I'm adding the rule with a "Refactor" severity,
meaning it's a rule we can break if necessary.
2019-10-23 14:39:31 +02:00
lalo
c2860dda0e Add can_comment and can_edit_dossier abilities to valuators 2019-06-11 16:24:02 +02:00
voodoorai2000
24dde9c35e Delete valuation 2019-05-31 15:43:06 +02:00
decabeza
13d0b08cb4 Adds styles and missing i18n for valuator groups 👨🏻‍🎨 2018-04-03 20:56:31 +02:00
rgarcia
1dbbe331c9 Assign valuators to groups 2018-04-03 20:55:44 +02:00
Angel Perez
db86cc5216 Enable 'destroy' action for Valuator on controller 2017-11-17 13:12:26 -04:00
Angel Perez
59c97b4db7 Enable search by name/email for Valuators 2017-10-25 10:16:21 -04: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
rgarcia
aaca99b46f orders valuators by spending proposal count 2016-04-26 23:33:19 +02:00
rgarcia
4bbd3d7233 adds summary of spending proposals by valuator 2016-04-26 22:06:02 +02:00
Juanjo Bazán
5b44de3bba makes description nil if blank 2016-03-19 12:15:02 +01:00
Juanjo Bazán
4546af5be1 redux of valuators creation form 2016-03-15 15:33:00 +01:00
rgarcia
b38558f2f3 adds index and create of valuators 2016-03-01 20:10:52 +01:00