Skip to content

Commit

Permalink
[#7] Implements website_url method on Facility model to handle websit…
Browse files Browse the repository at this point in the history
…e column content.
  • Loading branch information
fabionl committed Nov 21, 2021
1 parent ac06a59 commit b5967f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/facility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ def status
end
end

def website_url
return nil if website.blank?

if URI.parse(website).scheme.present?
website
else
"http://#{website}"
end
end

def coord
GeoLocation.coord(lat, long)
end
Expand Down

0 comments on commit b5967f5

Please sign in to comment.