Files
grecia/app/helpers/management_helper.rb
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

45 lines
1.3 KiB
Ruby

module ManagementHelper
def menu_users?
["users", "email_verifications", "document_verifications"].include?(controller_name)
end
def menu_edit_password_email?
controller_name == "account" && action_name == "edit_password_email"
end
def menu_edit_password_manually?
controller_name == "account" && action_name == "edit_password_manually"
end
def menu_create_proposal?
controller_name == "proposals" && action_name == "new"
end
def menu_support_proposal?
controller_name == "proposals" && action_name == "index"
end
def menu_print_proposals?
controller_name == "proposals" && action_name == "print"
end
def menu_create_investments?
(controller_name == "budget_investments" && action_name == "new") ||
(controller_name == "budgets" && action_name == "create_investments")
end
def menu_support_investments?
(controller_name == "budget_investments" && action_name == "index") ||
(controller_name == "budgets" && action_name == "support_investments")
end
def menu_print_investments?
(controller_name == "budget_investments" && action_name == "print") ||
(controller_name == "budgets" && action_name == "print_investments")
end
def menu_user_invites?
controller_name == "user_invites"
end
end