Class: Location

Inherits:
ActiveRecord::Base
  • Object
show all
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_locationObject



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

#titleObject



31
32
33
# File 'app/models/location.rb', line 31

def title
  self.complete_location
end