Skip to content

Instantly share code, notes, and snippets.

View lucaskunzler's full-sized avatar
🙃

Lucas Kunzler lucaskunzler

🙃
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lucaskunzler on github.
  • I am kunzler (https://keybase.io/kunzler) on keybase.
  • I have a public key ASDWb2unE7CJ3J9xzew9zOHJjbf9GtyJt-C30qkmaQ_zrgo

To claim this, I am signing this object:

class Biker < ApplicationRecord
has_many :deliveries
# as deliveries tem um ponto de origem (origin) e um de destino (destination)
def coordinates
[latitude, longitude]
end
def distance_to(location_id)
location = Location.find(location_id)
location.distance_from(self.coordinates) #calcula a distancia da location até o biker (em linha reta)