Module: ActiveRecord::ConnectionAdapters::PostGIS::ColumnMethods

Included in:
TableDefinition
Defined in:
lib/active_record/connection_adapters/postgis/column_methods.rb

Instance Method Summary collapse

Instance Method Details

#geography(name, options = {}) ⇒ Object



13
14
15
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 13

def geography(name, options = {})
  column(name, :geography, **options)
end

#geometry(name, options = {}) ⇒ Object



17
18
19
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 17

def geometry(name, options = {})
  column(name, :geometry, **options)
end

#geometry_collection(name, options = {}) ⇒ Object



21
22
23
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 21

def geometry_collection(name, options = {})
  column(name, :geometry_collection, **options)
end

#line_string(name, options = {}) ⇒ Object



25
26
27
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 25

def line_string(name, options = {})
  column(name, :line_string, **options)
end

#multi_line_string(name, options = {}) ⇒ Object



29
30
31
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 29

def multi_line_string(name, options = {})
  column(name, :multi_line_string, **options)
end

#multi_point(name, options = {}) ⇒ Object



33
34
35
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 33

def multi_point(name, options = {})
  column(name, :multi_point, **options)
end

#multi_polygon(name, options = {}) ⇒ Object



37
38
39
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 37

def multi_polygon(name, options = {})
  column(name, :multi_polygon, **options)
end

#spatial(name, options = {}) ⇒ Object



8
9
10
11
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 8

def spatial(name, options = {})
  raise "You must set a type. For example: 't.spatial type: :st_point'" unless options[:type]
  column(name, options[:type], **options)
end

#st_point(name, options = {}) ⇒ Object



41
42
43
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 41

def st_point(name, options = {})
  column(name, :st_point, **options)
end

#st_polygon(name, options = {}) ⇒ Object



45
46
47
# File 'lib/active_record/connection_adapters/postgis/column_methods.rb', line 45

def st_polygon(name, options = {})
  column(name, :st_polygon, **options)
end