Skip to content

Commit

Permalink
add new valid_column_definition_options
Browse files Browse the repository at this point in the history
  • Loading branch information
seuros committed Sep 17, 2023
1 parent 54b51cc commit b2dbe79
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Gemfile.lock
.idea
debug.log
/test/db/*
.env
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def activerecord_version
end

# Need to install for tests
gem 'dotenv-rails', require: 'dotenv/rails-now'
gem "rails", github: "rails/rails", tag: "v#{activerecord_version}"

group :development do
# Gems used by the ActiveRecord test suite
gem "bcrypt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module ActiveRecord
module ConnectionAdapters
module PostGIS
module ColumnMethods

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)
Expand Down Expand Up @@ -44,6 +45,11 @@ def st_point(name, options = {})
def st_polygon(name, options = {})
column(name, :st_polygon, **options)
end

private
def valid_column_definition_options
super + [:srid, :has_z, :has_m, :geographic, :spatial_type]
end
end
end

Expand Down
3 changes: 2 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

require "bundler/setup"
Bundler.require :development

require 'dotenv'
Dotenv.load
require "minitest/autorun"
require "minitest/pride"
require "mocha/minitest"
Expand Down

0 comments on commit b2dbe79

Please sign in to comment.