Class: UpdateFeaturesJob

Inherits:
Struct
  • Object
show all
Defined in:
lib/spatial_features/workers/update_features_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



1
2
3
# File 'lib/spatial_features/workers/update_features_job.rb', line 1

def options
  @options
end

Instance Method Details

#performObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/spatial_features/workers/update_features_job.rb', line 2

def perform
  model = options[:spatial_model_type].find(options[:spatial_model_id])

  if model.update_features!
    Array(options[:cache_classes]).each {|klass| SpatialFeatures.cache_record_proximity(model, klass) }
    after_feature_update(model)
  end
rescue => e
  raise "Can't refresh geometry: #{normalize_message(e.message)}"
end