Skip to content

Commit

Permalink
Rails 8 is out, and we drag along a swap from annotate to annotaterb (#…
Browse files Browse the repository at this point in the history
…1098)

* Go to final Rails 8
* Swap to AnnotateRB since Annotate is no longer maintained.
  • Loading branch information
epugh authored Nov 8, 2024
1 parent fececb6 commit 023136e
Show file tree
Hide file tree
Showing 20 changed files with 565 additions and 185 deletions.
58 changes: 58 additions & 0 deletions .annotaterb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: false
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:ignore_columns:
:ignore_routes:
:models: true
:routes: true
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gem 'postmark-rails'
gem 'prophet-rb', '~> 0.5.0'
gem 'puma'
gem 'pundit'
gem 'rails', '8.0.0.rc2'
gem 'rails', '8.0.0'
gem 'rails-html-sanitizer'
gem 'rack-cors', '~> 2.0'
gem 'responders'
Expand All @@ -58,7 +58,6 @@ gem 'vega'
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem 'debug', platforms: [ :mri, :windows ], require: 'debug/prelude'
gem 'annotate'
# gem 'bullet' not Rails 8 compatible
gem 'bullet', git: 'https://github.com/adiaz04/bullet.git', branch: 'main'
gem 'memory_profiler'
Expand All @@ -68,6 +67,7 @@ group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem 'web-console'

gem 'annotaterb', '~> 4.13'
# this was commented out in the default build, so doing the same..
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem 'rack-mini-profiler'
Expand Down
114 changes: 56 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,70 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actioncable (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
activejob (= 8.0.0.rc2)
activerecord (= 8.0.0.rc2)
activestorage (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actionmailbox (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
actionmailer (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
actionview (= 8.0.0.rc2)
activejob (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actionmailer (8.0.0)
actionpack (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activesupport (= 8.0.0)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.0.0.rc2)
actionview (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actionpack (8.0.0)
actionview (= 8.0.0)
activesupport (= 8.0.0)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
activerecord (= 8.0.0.rc2)
activestorage (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actiontext (8.0.0)
actionpack (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.0.0.rc2)
activesupport (= 8.0.0.rc2)
actionview (8.0.0)
activesupport (= 8.0.0)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
active_storage_db (1.3.1)
activestorage (>= 6.0)
rails (>= 6.0)
activejob (8.0.0.rc2)
activesupport (= 8.0.0.rc2)
activejob (8.0.0)
activesupport (= 8.0.0)
globalid (>= 0.3.6)
activemodel (8.0.0.rc2)
activesupport (= 8.0.0.rc2)
activerecord (8.0.0.rc2)
activemodel (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
activemodel (8.0.0)
activesupport (= 8.0.0)
activerecord (8.0.0)
activemodel (= 8.0.0)
activesupport (= 8.0.0)
timeout (>= 0.4.0)
activerecord-import (1.8.1)
activerecord (>= 4.2)
activestorage (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
activejob (= 8.0.0.rc2)
activerecord (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
activestorage (8.0.0)
actionpack (= 8.0.0)
activejob (= 8.0.0)
activerecord (= 8.0.0)
activesupport (= 8.0.0)
marcel (~> 1.0)
activesupport (8.0.0.rc2)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -105,9 +105,7 @@ GEM
aes_key_wrap (1.1.0)
ancestry (4.3.3)
activerecord (>= 5.2.6)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
annotaterb (4.13.0)
ansi (1.5.0)
apipie-rails (1.4.2)
actionpack (>= 5.0)
Expand Down Expand Up @@ -376,20 +374,20 @@ GEM
rack (>= 1.3)
rackup (2.2.0)
rack (>= 3)
rails (8.0.0.rc2)
actioncable (= 8.0.0.rc2)
actionmailbox (= 8.0.0.rc2)
actionmailer (= 8.0.0.rc2)
actionpack (= 8.0.0.rc2)
actiontext (= 8.0.0.rc2)
actionview (= 8.0.0.rc2)
activejob (= 8.0.0.rc2)
activemodel (= 8.0.0.rc2)
activerecord (= 8.0.0.rc2)
activestorage (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
rails (8.0.0)
actioncable (= 8.0.0)
actionmailbox (= 8.0.0)
actionmailer (= 8.0.0)
actionpack (= 8.0.0)
actiontext (= 8.0.0)
actionview (= 8.0.0)
activejob (= 8.0.0)
activemodel (= 8.0.0)
activerecord (= 8.0.0)
activestorage (= 8.0.0)
activesupport (= 8.0.0)
bundler (>= 1.15.0)
railties (= 8.0.0.rc2)
railties (= 8.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -406,9 +404,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (8.0.0.rc2)
actionpack (= 8.0.0.rc2)
activesupport (= 8.0.0.rc2)
railties (8.0.0)
actionpack (= 8.0.0)
activesupport (= 8.0.0)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand Down Expand Up @@ -546,7 +544,7 @@ DEPENDENCIES
addressable (~> 2.8)
ancestry
angular-rails-templates!
annotate
annotaterb (~> 4.13)
apipie-rails (~> 1.2)
bcrypt (~> 3.1.7)
bootsnap
Expand Down Expand Up @@ -586,7 +584,7 @@ DEPENDENCIES
puma
pundit
rack-cors (~> 2.0)
rails (= 8.0.0.rc2)
rails (= 8.0.0)
rails-controller-testing
rails-erd (~> 1.6)
rails-html-sanitizer
Expand Down
17 changes: 9 additions & 8 deletions app/jobs/google_analytics_event_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
class GoogleAnalyticsEventJob < ApplicationJob
queue_as :default

def perform data
def perform _data
return unless Analytics::GoogleAnalytics.enabled?

Analytics::GoogleAnalytics.ga.event(
data[:category],
data[:action],
data[:label],
data[:value],
data[:bounce] || false
)
nil # avoid NameError: uninitialized constant URI::PATTERN
# Analytics::GoogleAnalytics.ga.event(
# data[:category],
# data[:action],
# data[:label],
# data[:value],
# data[:bounce] || false
# )
end
end
3 changes: 2 additions & 1 deletion app/models/case.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# rubocop:disable Metrics/ClassLength

# == Schema Information
#
# Table name: cases
Expand All @@ -25,7 +27,6 @@
# cases_ibfk_1 (owner_id => users.id)
#

# rubocop:disable Metrics/ClassLength
class Case < ApplicationRecord
# Associations
# too late now!
Expand Down
4 changes: 2 additions & 2 deletions app/models/permission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# Table name: permissions
#
# id :integer not null, primary key
# user_id :integer
# model_type :string(255) not null
# action :string(255) not null
# model_type :string(255) not null
# on :boolean default(FALSE)
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer
#

class Permission < ApplicationRecord
Expand Down
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# rubocop:disable Metrics/ClassLength

# == Schema Information
#
# Table name: users
Expand Down Expand Up @@ -46,7 +48,6 @@
# fk_rails_... (default_scorer_id => scorers.id)
#

# rubocop:disable Metrics/ClassLength
class User < ApplicationRecord
# Associations

Expand Down
19 changes: 10 additions & 9 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# frozen_string_literal: true

require 'active_support/core_ext/integer/time'
# Sprockets.register_compressor 'application/javascript', :terser, Terser::Compressor

# rubocop:disable Metrics/BlockLength
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down Expand Up @@ -35,15 +36,14 @@

# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :db # :local



# Enable detailed ActionCable logging
config.action_cable.log_tags = [
:channel,
:connection,
:transmissions,
:state_updates
]
config.action_cable.log_tags = [
:channel,
:connection,
:transmissions,
:state_updates
]

config.action_cable.disable_request_forgery_protection = true
config.action_cable.allowed_request_origins = '*'
Expand Down Expand Up @@ -111,3 +111,4 @@
# authentication: :plain
# }
end
# rubocop:enable Metrics/BlockLength
Loading

0 comments on commit 023136e

Please sign in to comment.