Skip to content

Instantly share code, notes, and snippets.

@denoww
Created April 25, 2016 11:26
Show Gist options
  • Save denoww/c6e235896e97e65e6ecdc0f33dd82442 to your computer and use it in GitHub Desktop.
Save denoww/c6e235896e97e65e6ecdc0f33dd82442 to your computer and use it in GitHub Desktop.
Duas formas de organizar cobranças vencidas e jurídicas
Abordagem A
Cobranca.vencidas
|-------------------| cob.vencida? # true
cob.atraso = 100 dias
cob.vencidas # retorna lista das vencidas, mas não as juridicas
Cobranca.juridicas
|-------------------| cob.vencida? # false
cob.atraso = 100 dias
Abordagem B
Cobranca.vencidas
|---------------------------------------| cob.vencida? # true
cob.atraso = 100 dias
cob.vencidas # retorna lista das vencidas e juridicas
Cobranca.juridicas
|-------------------| cob.vencida? # true
cob.atraso = 100 dias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment