Skip to content

Instantly share code, notes, and snippets.

@paulodiniz
Created October 15, 2015 12:03
Show Gist options
  • Save paulodiniz/f3621082866e9a1b203d to your computer and use it in GitHub Desktop.
Save paulodiniz/f3621082866e9a1b203d to your computer and use it in GitHub Desktop.
class Carro
def Carro.valor_do_financiamento(carro_id)
carro = Carro.find(carro_id)
#calcula valor
return valor_total
end
end
carro = Carro.find(params[:carro_id]) # carrega o carro que o usuario passou no POST
valor_do_financiamento = Carro.valor_do_financiamento(carro.id)
#####################################
class Carro
def valor_do_financiamento
#calcula valor
return valor_total
end
end
carro = Carro.find(params[:carro_id])
valor_do_financiamento = carro.valor_do_financiamento
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment