app/models/feature.rb in spatial_features-3.4.2 vs app/models/feature.rb in spatial_features-3.4.8
- old
+ new
@@ -7,9 +7,11 @@
class_attribute :lowres_precision
self.lowres_precision = 5
has_one :aggregate_feature, lambda { |feature| where(:spatial_model_type => feature.spatial_model_type) }, :foreign_key => :spatial_model_id, :primary_key => :spatial_model_id
+ scope :source_identifier, lambda {|source_identifier| where(:source_identifier => source_identifier) if source_identifier.present? }
+
validates_inclusion_of :feature_type, :in => FEATURE_TYPES
before_save :truncate_name
after_save :refresh_aggregate, if: :automatically_refresh_aggregate?