Commit Graph

18 Commits

Author SHA1 Message Date
Javi Martín
790170a27c Use keyword arguments in tag methods
The interface of this method has changed and uses keyword arguments
instead of a hash of options. This change will be particularly
significant when upgrading to Ruby 3.
2022-08-24 15:10:36 +02:00
Javi Martín
749428d93f Replace content_tag with new tag builder syntax
One of the main advantages of this syntax is we can now omit the content
parameter when it's empty.
2020-04-27 19:26:37 +02: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
eac7427755 Remove line auto-assigning a variable to nil
This is one of the most strange behaviours in ruby: if a variable
doesn't exist, assigning to itself will return `nil`.

So a line like:

mdmkdfm = ooops if mdmkdfm.respond_to?(:uiqpior)

Surprisingly will not raise any errors: the nonexistent `mdmkdfm`
variable will be evaluated to `nil`, `mdmkdfm.respond_to?(:uiqpior)`
will evaluate to `nil.respond_to?(:uiqpior)`, which will return `false`,
and then the line will be evaluated as `mdmkdfm = ooops if false`, which
will return `nil`.

Maybe in the future Ruby will change this behaviour. We hope CONSUL is
now in better shape if that ever happens :).
2019-09-29 22:52:53 +02:00
Javi Martín
c4c0301f3f Simplify stats images styles
This way we don't need to manually define the width we think the image
we insert in the `::before` pseudoclass is going to take.
2019-05-21 13:50:16 +02:00
Javi Martín
4ade857a1b Extract method to render number and info
We're going to use it in many places, so removing duplication is useful.
2019-05-21 13:50:16 +02:00
Javi Martín
c0044f4e56 Extract method to show stats percentage 2019-05-21 13:50:15 +02:00
Javi Martín
ccaa2e1a77 Remove duplication to calculate percentage 2019-05-21 13:49:42 +02:00
Bertocq
4be44835a8 Add calculate_percentaje helper function to stats helper 2019-05-21 13:26:44 +02:00
rgarcia
cfe3f95f5c moves graphs to individual views 2019-05-16 13:37:47 +02:00
Julian Herrero
b460c024f3 Use double quotes in app/helpers 2019-03-15 09:26:49 +01:00
Bertocq
d7b8777395 Fix all Layout/SpaceAroundEqualsInParameterDefault rubocop issues from rubocop_todo list 2017-06-26 18:03:40 +02:00
Alberto Garcia Cabeza
45af9ce5aa adds budget investments numbers and chart on admin stats 2017-04-25 16:46:20 +02: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
inobcr
e2610e15e7 Add_stats_for_Investment_Proyect_#918 2016-03-21 18:18:18 +01:00
kikito
adc8275f5a moves the admin api inside of the /admin namespace 2015-09-24 12:11:51 +02:00
rgarcia
4897d5df4e makes spaces consistent 2015-09-03 01:29:46 +02:00
Eloy Gomez
5b0cd4a8ba Show charts using c3.js 2015-08-17 19:15:17 +02:00