Class: Goldencobra::Location
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Goldencobra::Location
- Defined in:
- app/models/goldencobra/location.rb
Instance Attribute Summary collapse
-
#skip_geocode ⇒ Object
Returns the value of attribute skip_geocode.
Instance Method Summary collapse
- #complete_location ⇒ Object
- #safe_geocode ⇒ Object
- #skip_geocoding_once_or_always ⇒ Object
- #title ⇒ Object
Instance Attribute Details
#skip_geocode ⇒ Object
Returns the value of attribute skip_geocode.
29 30 31 |
# File 'app/models/goldencobra/location.rb', line 29 def skip_geocode @skip_geocode end |
Instance Method Details
#complete_location ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/models/goldencobra/location.rb', line 42 def complete_location result = "" result += "#{self.street}" if self.street.present? result += " #{self.street_number}" if self.street_number.present? result += ", #{self.zip}" if self.zip.present? result += " #{self.city}" if self.city.present? end |
#safe_geocode ⇒ Object
34 35 36 37 |
# File 'app/models/goldencobra/location.rb', line 34 def safe_geocode geocode rescue Geocoder::OverQueryLimitError end |
#skip_geocoding_once_or_always ⇒ Object
54 55 56 57 |
# File 'app/models/goldencobra/location.rb', line 54 def skip_geocoding_once_or_always (Goldencobra::Setting.for_key("goldencobra.locations.geocoding") == "false" ) || self.skip_geocode || self.manual_geocoding end |
#title ⇒ Object
50 51 52 |
# File 'app/models/goldencobra/location.rb', line 50 def title self.complete_location end |