26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/geostats/models/cache.rb', line 26
def update_from_website
info = Grabber::Cache.new(self.uuid)
[:name, :code, :size, :latitude, :longitude, :difficulty, :terrain,
:location, :owner, :hidden_at, :founds_count, :dnf_count
].each do |attribute|
if value = info.send(attribute)
self.attributes = { attribute => value }
end
end
self.is_pmonly = info.pmonly?
self.is_archived = info.archived?
if type = info.type and index = CacheType::MAPPING.index(type)
self.cache_type = CacheType.where(:id => index + 1).first
end
self.synced_at = Time.now
end
|