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 Aug 26, 2024
1 parent ab044bf commit 1a937de
Show file tree
Hide file tree
Showing 18 changed files with 230 additions and 139 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
133 changes: 65 additions & 68 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.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.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.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.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.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.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.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.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.3.4)
activesupport (= 7.1.3.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.3.4)
activesupport (= 7.1.3.4)
activejob (7.2.0)
activesupport (= 7.2.0)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.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.7.0)
activerecord (>= 4.2)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.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.3.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.14)
Expand Down Expand Up @@ -445,20 +440,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.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.3.4)
railties (= 7.2.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -476,10 +471,10 @@ GEM
rails_param (1.3.1)
actionpack (>= 3.2.0)
activesupport (>= 3.2.0)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.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 @@ -545,6 +540,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 @@ -592,6 +588,7 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uri (0.13.0)
useragent (0.16.10)
validates_email_format_of (1.8.2)
i18n (>= 0.8.0)
simpleidn
Expand Down Expand Up @@ -688,7 +685,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
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
22 changes: 11 additions & 11 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Show full error reports.
config.consider_all_requests_local = true

# Enable server timing
# Enable server timing.
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
Expand All @@ -24,9 +24,7 @@
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
else
config.action_controller.perform_caching = false

Expand All @@ -39,8 +37,12 @@
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

# Disable caching for Action Mailer templates even if Action Controller
# caching is enabled.
config.action_mailer.perform_caching = false

config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

Expand All @@ -59,11 +61,6 @@
# Highlight code that enqueued background job in logs.
config.active_job.verbose_enqueue_logs = true

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

# Suppress logger output for asset requests.
config.assets.quiet = true

Expand All @@ -74,14 +71,17 @@
# config.i18n.raise_on_missing_translations = true

# Annotate rendered view with file names.
# config.action_view.annotate_rendered_view_with_filenames = true
config.action_view.annotate_rendered_view_with_filenames = true

# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true

# Raise error when a before_action's only/except options reference missing actions
# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true

# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate!

# Disable host validation.
config.hosts = []
end
Loading

0 comments on commit 1a937de

Please sign in to comment.