Skip to content

Instantly share code, notes, and snippets.

@azuby
Created February 18, 2012 15:30
Show Gist options
  • Save azuby/1859793 to your computer and use it in GitHub Desktop.
Save azuby/1859793 to your computer and use it in GitHub Desktop.
def jobs_within(radius)
return [] unless location
jobs = []
company.jobs.each do |j|
if j.location && j.location.distance_from(location) < (radius + location.radius)
jobs += j
end
end
return jobs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment