Class: Location
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Location
- Defined in:
- app/models/location.rb
Overview
Schema Information
Table name: locations
id :integer not null, primary key
lat :string(255)
lng :string(255)
street :string(255)
city :string(255)
zip :string(255)
region :string(255)
country :string(255)
created_at :datetime not null
updated_at :datetime not null
title :string(255)
Instance Method Summary collapse
Instance Method Details
#complete_location ⇒ Object
24 25 26 27 28 29 |
# File 'app/models/location.rb', line 24 def complete_location result = "" result += "#{self.street}" if self.street.present? result += ", #{self.zip}" if self.zip.present? result += ", #{self.city}" if self.city.present? end |
#title ⇒ Object
31 32 33 |
# File 'app/models/location.rb', line 31 def title self.complete_location end |