Skip to content

Commit

Permalink
Update to rails 7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Sep 17, 2024
1 parent 6789fc3 commit be2678e
Show file tree
Hide file tree
Showing 18 changed files with 231 additions and 140 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

# Require rails
gem "rails", "~> 7.1.0"
gem "rails", "~> 7.2.0"
gem "turbo-rails"

# Require json for multi_json
Expand Down
135 changes: 66 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,82 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
actioncable (7.2.0)
actionpack (= 7.2.0)
activesupport (= 7.2.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.4)
actionpack (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activesupport (= 7.1.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.0)
actionpack (= 7.2.0)
activejob (= 7.2.0)
activerecord (= 7.2.0)
activestorage (= 7.2.0)
activesupport (= 7.2.0)
mail (>= 2.8.0)
actionmailer (7.2.0)
actionpack (= 7.2.0)
actionview (= 7.2.0)
activejob (= 7.2.0)
activesupport (= 7.2.0)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.4)
actionview (= 7.1.4)
activesupport (= 7.1.4)
actionpack (7.2.0)
actionview (= 7.2.0)
activesupport (= 7.2.0)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actionpack-page_caching (1.2.4)
actionpack (>= 4.0.0)
actiontext (7.1.4)
actionpack (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
actiontext (7.2.0)
actionpack (= 7.2.0)
activerecord (= 7.2.0)
activestorage (= 7.2.0)
activesupport (= 7.2.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.4)
activesupport (= 7.1.4)
actionview (7.2.0)
activesupport (= 7.2.0)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_record_union (1.3.0)
activerecord (>= 4.0)
activejob (7.1.4)
activesupport (= 7.1.4)
activejob (7.2.0)
activesupport (= 7.2.0)
globalid (>= 0.3.6)
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
activemodel (7.2.0)
activesupport (= 7.2.0)
activerecord (7.2.0)
activemodel (= 7.2.0)
activesupport (= 7.2.0)
timeout (>= 0.4.0)
activerecord-import (1.8.1)
activerecord (>= 4.2)
activestorage (7.1.4)
actionpack (= 7.1.4)
activejob (= 7.1.4)
activerecord (= 7.1.4)
activesupport (= 7.1.4)
activestorage (7.2.0)
actionpack (= 7.2.0)
activejob (= 7.2.0)
activerecord (= 7.2.0)
activesupport (= 7.2.0)
marcel (~> 1.0)
activesupport (7.1.4)
activesupport (7.2.0)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
annotate (3.2.0)
Expand Down Expand Up @@ -346,7 +342,6 @@ GEM
multi_json (1.15.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
mutex_m (0.2.0)
net-http (0.4.1)
uri
net-imap (0.4.16)
Expand Down Expand Up @@ -446,20 +441,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.4)
actioncable (= 7.1.4)
actionmailbox (= 7.1.4)
actionmailer (= 7.1.4)
actionpack (= 7.1.4)
actiontext (= 7.1.4)
actionview (= 7.1.4)
activejob (= 7.1.4)
activemodel (= 7.1.4)
activerecord (= 7.1.4)
activestorage (= 7.1.4)
activesupport (= 7.1.4)
rails (7.2.0)
actioncable (= 7.2.0)
actionmailbox (= 7.2.0)
actionmailer (= 7.2.0)
actionpack (= 7.2.0)
actiontext (= 7.2.0)
actionview (= 7.2.0)
activejob (= 7.2.0)
activemodel (= 7.2.0)
activerecord (= 7.2.0)
activestorage (= 7.2.0)
activesupport (= 7.2.0)
bundler (>= 1.15.0)
railties (= 7.1.4)
railties (= 7.2.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -477,10 +472,10 @@ GEM
rails_param (1.3.1)
actionpack (>= 3.2.0)
activesupport (>= 3.2.0)
railties (7.1.4)
actionpack (= 7.1.4)
activesupport (= 7.1.4)
irb
railties (7.2.0)
actionpack (= 7.2.0)
activesupport (= 7.2.0)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -544,6 +539,7 @@ GEM
sass-embedded (1.64.2)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
securerandom (0.3.1)
selenium-webdriver (4.23.0)
base64 (~> 0.2)
logger (~> 1.4)
Expand Down Expand Up @@ -590,6 +586,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (0.13.1)
useragent (0.16.10)
validates_email_format_of (1.8.2)
i18n (>= 0.8.0)
simpleidn
Expand Down Expand Up @@ -686,7 +683,7 @@ DEPENDENCIES
quad_tile (~> 1.0.1)
rack-cors
rack-uri_sanitizer
rails (~> 7.1.0)
rails (~> 7.2.0)
rails-controller-testing
rails-i18n (~> 7.0.0)
rails_param
Expand Down Expand Up @@ -715,4 +712,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
2.4.19
2.5.11
2 changes: 1 addition & 1 deletion app/models/old_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class OldNode < ApplicationRecord
belongs_to :redaction, :optional => true
belongs_to :current_node, :class_name => "Node", :foreign_key => "node_id", :inverse_of => :old_nodes

has_many :old_tags, :class_name => "OldNodeTag", :query_constraints => [:node_id, :version], :inverse_of => :old_node
has_many :old_tags, :class_name => "OldNodeTag", :foreign_key => [:node_id, :version], :inverse_of => :old_node

def validate_position
errors.add(:base, "Node is not in the world") unless in_world?
Expand Down
2 changes: 1 addition & 1 deletion app/models/old_node_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class OldNodeTag < ApplicationRecord
self.table_name = "node_tags"

belongs_to :old_node, :query_constraints => [:node_id, :version], :inverse_of => :old_tags
belongs_to :old_node, :foreign_key => [:node_id, :version], :inverse_of => :old_tags

validates :old_node, :associated => true
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
Expand Down
4 changes: 2 additions & 2 deletions app/models/old_relation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class OldRelation < ApplicationRecord
belongs_to :redaction, :optional => true
belongs_to :current_relation, :class_name => "Relation", :foreign_key => "relation_id", :inverse_of => :old_relations

has_many :old_members, -> { order(:sequence_id) }, :class_name => "OldRelationMember", :query_constraints => [:relation_id, :version], :inverse_of => :old_relation
has_many :old_tags, :class_name => "OldRelationTag", :query_constraints => [:relation_id, :version], :inverse_of => :old_relation
has_many :old_members, -> { order(:sequence_id) }, :class_name => "OldRelationMember", :foreign_key => [:relation_id, :version], :inverse_of => :old_relation
has_many :old_tags, :class_name => "OldRelationTag", :foreign_key => [:relation_id, :version], :inverse_of => :old_relation

validates :changeset, :associated => true
validates :timestamp, :presence => true
Expand Down
2 changes: 1 addition & 1 deletion app/models/old_relation_member.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class OldRelationMember < ApplicationRecord
self.table_name = "relation_members"

belongs_to :old_relation, :query_constraints => [:relation_id, :version], :inverse_of => :old_members
belongs_to :old_relation, :foreign_key => [:relation_id, :version], :inverse_of => :old_members
# A bit messy, referring to the current tables, should do for the data browser for now
belongs_to :member, :polymorphic => true

Expand Down
2 changes: 1 addition & 1 deletion app/models/old_relation_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class OldRelationTag < ApplicationRecord
self.table_name = "relation_tags"

belongs_to :old_relation, :query_constraints => [:relation_id, :version], :inverse_of => :old_tags
belongs_to :old_relation, :foreign_key => [:relation_id, :version], :inverse_of => :old_tags

validates :old_relation, :associated => true
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
Expand Down
4 changes: 2 additions & 2 deletions app/models/old_way.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class OldWay < ApplicationRecord
belongs_to :redaction, :optional => true
belongs_to :current_way, :class_name => "Way", :foreign_key => "way_id", :inverse_of => :old_ways

has_many :old_nodes, :class_name => "OldWayNode", :query_constraints => [:way_id, :version], :inverse_of => :old_way
has_many :old_tags, :class_name => "OldWayTag", :query_constraints => [:way_id, :version], :inverse_of => :old_way
has_many :old_nodes, :class_name => "OldWayNode", :foreign_key => [:way_id, :version], :inverse_of => :old_way
has_many :old_tags, :class_name => "OldWayTag", :foreign_key => [:way_id, :version], :inverse_of => :old_way

validates :changeset, :associated => true
validates :timestamp, :presence => true
Expand Down
2 changes: 1 addition & 1 deletion app/models/old_way_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class OldWayNode < ApplicationRecord
self.table_name = "way_nodes"

belongs_to :old_way, :query_constraints => [:way_id, :version], :inverse_of => :old_nodes
belongs_to :old_way, :foreign_key => [:way_id, :version], :inverse_of => :old_nodes
# A bit messy, referring to current nodes and ways, should do for the data browser for now
belongs_to :node
belongs_to :way
Expand Down
2 changes: 1 addition & 1 deletion app/models/old_way_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class OldWayTag < ApplicationRecord
self.table_name = "way_tags"

belongs_to :old_way, :query_constraints => [:way_id, :version], :inverse_of => :old_tags
belongs_to :old_way, :foreign_key => [:way_id, :version], :inverse_of => :old_tags

validates :old_way, :associated => true
validates :k, :v, :allow_blank => true, :length => { :maximum => 255 }, :characters => true
Expand Down
7 changes: 7 additions & 0 deletions bin/brakeman
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

ARGV.unshift("--ensure-latest")

load Gem.bin_path("brakeman", "brakeman")
8 changes: 8 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

# explicit rubocop config increases performance slightly while avoiding config confusion.
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))

load Gem.bin_path("rubocop", "rubocop")
6 changes: 5 additions & 1 deletion bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require "fileutils"

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "openstreetmap".freeze

def system!(*args)
system(*args, :exception => true)
Expand Down Expand Up @@ -30,4 +30,8 @@ FileUtils.chdir APP_ROOT do

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
end
Loading

0 comments on commit be2678e

Please sign in to comment.