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

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

Instance Method Summary collapse

Instance Method Details

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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

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


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

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


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

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

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


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

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