Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6 #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ gem 'active_record-acts_as', git: 'https://github.com/camsys/active_record-acts_

# To use debugger
# gem 'debugger'
gem 'transam_core', git: 'https://github.com/camsys/transam_core', branch: :quarter4
gem 'transam_core', git: 'https://github.com/nycdot/transam_core.git', branch: 'rails-6'
# gem 'transam_core', path: "../transam_core"

# needed for testing spatial mixins on transit models
gem 'transam_transit', git: 'https://github.com/camsys/transam_transit', branch: :quarter4
gem 'transam_transit', git: 'https://github.com/nycdot/transam_transit.git', branch: 'rails-6'
# gem 'transam_transit', path: "../transam_transit"

gem 'mysql2', "~> 0.5.1" # lock gem for dummy app
gem "capybara", '2.6.2' # lock gem for old capybara behavior on hidden element xpath
gem 'activerecord-mysql2rgeo-adapter', git: 'https://github.com/camsys/activerecord-mysql2rgeo-adapter', branch: 'master'
gem "rgeo"
gem "rgeo", '2.4.0'
gem 'rgeo-geojson'
gem 'rgeo-proj4'
gem 'rgeo-proj4', '3.1.1'
gem 'figaro' # need to add an application.yml because need API keys to test geocode libraries

group :development, :test do
Expand Down
5 changes: 3 additions & 2 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#encoding: utf-8

# determine if we are using postgres or mysql
is_mysql = (ActiveRecord::Base.configurations[Rails.env]['adapter'].include? 'mysql2')
is_sqlite = (ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'sqlite3')
active_record_config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'primary').configuration_hash
is_mysql = (active_record_config[:adapter].include? 'mysql2')
is_sqlite = (active_record_config[:adapter] == 'sqlite3')

#------------------------------------------------------------------------------
#
Expand Down
16 changes: 10 additions & 6 deletions lib/transam_spatial/transam_geo_locatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,21 @@ def update_geometry
end

# set nodes if used
if _use_nodes
if _use_nodes && parser.from_node.present?
if self.from_node && (self.from_node != parser.from_node)
puts "node mismatch for #{order_number}! #{self.from_node} != #{parser.from_node}"
else
self.from_node = parser.from_node
Rails.logger.debug "node mismatch for #{order_number}! #{self.from_node} != #{parser.from_node}"
end

self.from_node = parser.from_node
end

if _use_nodes && parser.to_node.present?
if self.to_node && (self.to_node != parser.to_node)
puts "node mismatch for #{order_number}! #{self.to_node} != #{parser.to_node}"
else
self.to_node = parser.to_node
Rails.logger.debug "node mismatch for #{order_number}! #{self.to_node} != #{parser.to_node}"
end

self.to_node = parser.to_node
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions transam_spatial.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Gem::Specification.new do |s|

s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]

s.add_dependency 'rails', '~> 5.2'
s.add_dependency 'rails', '~> 6.1', '>= 6.1.7.3'

s.add_dependency 'rails-data-migrations'

s.add_dependency "geocoder"
s.add_dependency "geocoder", '1.5.1'

s.add_development_dependency "georuby", '~> 2.2.1'
s.add_development_dependency "rspec-rails"
s.add_development_dependency "factory_bot_rails"
s.add_development_dependency "factory_bot_rails", '4.11.1'
s.add_development_dependency "database_cleaner"
s.add_development_dependency "mysql2"
s.add_development_dependency "cucumber-rails"
Expand Down