Last active
May 28, 2019 01:11
-
-
Save Kamilahsantos/aa62163b88964e6ac45b62d6c84a747b to your computer and use it in GitHub Desktop.
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
def inativar_clientes | |
clientes= clientes_para_inativar | |
clientes.each(&:deactivate) | |
AvisarClientePorWpp.inativados(clientes) | |
end | |
def clientes_para_inativar | |
Clientes.all.select do |cliente| | |
cliente.ultima_compra > 1.month.ago && cliente.ativo? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment