Module: SpatialFeatures::SQLHelpers

Defined in:
lib/spatial_features/has_spatial_features.rb

Class Method Summary collapse

Class Method Details

.append_select(scope, *fields) ⇒ Object

Add select fields without replacing the implicit ‘table_name.*`



38
39
40
41
42
43
# File 'lib/spatial_features/has_spatial_features.rb', line 38

def self.append_select(scope, *fields)
  if(!scope.select_values.any?)
    fields.unshift(scope.arel_table[Arel.star])
  end
  scope.select(*fields)
end