This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Help you see referenced PR's And issues faster by hidding comments | |
javascript:(document.querySelectorAll(".edit-comment-hide").forEach(function(el){if (el.style.display === "none") {el.style.display = "block";} else {el.style.display = "none";}})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Taken from expertise.jetruby.com | |
Controller checklist | |
- the controller doesn’t have any business logic | |
- the controller doesn’t have any controlling constructions (except from “if success? then respond_with_success else respond_with_error end”) | |
- the controller doesn’t know anything about how the data is arranged (to make the user active, you need to call “current_user.activate!”, not current_user.update(status: ‘active’)) | |
- there’s no duplicated logic for new, create and edit, update actions. The records should be in “before_action” | |
- in the “action” methods there is no validation of whether those methods can be executed (put all of that in “before_filter”). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
n = 10000000 | |
def with | |
remaining = 5000 | |
step = 200 | |
while remaining > 0 | |
if remaining < step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Metrics/LineLength: | |
Description: 'Limit lines to 120 characters.' | |
StyleGuide: '#120-character-limits' | |
Enabled: true | |
Max: 120 | |
Metrics/ClassLength: | |
Enabled: false | |
Metrics/AbcSize: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
openapi: 3.0.3 | |
info: | |
title: Arcus AutoPay | |
description: "Arcus \"Autopay\" es un servicio que permite el registro de facturas para pagos recurrentes y pagos únicos\n\n# Autenticación\n\n## Descripción\n\nEste sección del documento describe el método de autenticación requerido para habilitar la comunicación de servidor a servidor con Arcus API.\n\n## Método de Autenticación\n\nArcus API usa autenticación JSON Web Token, como se define en RFC7519. La generación del token se realiza del lado del cliente, mientras que Arcus se realizara las validaciones del token generado por el cliente.\n\n## Definición JWT\n\n### Header\n\nEl header debe contener los siguientes valores\n\n| Claim | Description | \n| ----- | ----------- |\n| alg | El algoritmo principal en uso para firmar, para Arcus API debe ser siempre HS256 que presenta HMAC usando un algoritmo hash SHA-256 |\n| typ | El tipo de medio de JWT, para Arcus API siempre debe ser JWT |\n\nUn ejemplo de un header con buen formato es:\n\n```json\n{ \"alg\":\" |