diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index d04a315..d9e6bdd 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -10,10 +10,10 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest services: mysql: - image: mysql:5.5 + image: mariadb:10.11.19 ports: - "3306:3306" env: @@ -27,7 +27,7 @@ jobs: MYSQL_TEST_DATABASE: rails_test steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Ruby and gems uses: ruby/setup-ruby@v1 diff --git a/.ruby-version b/.ruby-version index f0c2138..618659f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.8 +3.4.13 diff --git a/Dockerfile b/Dockerfile index c66b6bd..b9eb392 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM ruby:2.7.8-alpine +FROM ruby:3.4.13-alpine RUN apk --no-cache add build-base mysql-dev tzdata RUN mkdir /anrop WORKDIR /anrop ADD Gemfile /anrop/Gemfile ADD Gemfile.lock /anrop/Gemfile.lock -RUN bundle install -j4 +RUN bundle install ADD . /anrop CMD rm -f tmp/pids/server.pid && rails server -b '0.0.0.0' diff --git a/Gemfile b/Gemfile index 0bb7c11..544eded 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source 'https://rubygems.org' -ruby '2.7.8' +ruby '3.4.13' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '5.2.8.1' +gem 'rails', '8.1.4.1' # Use mysql2 as the database for Active Record gem 'mysql2' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder @@ -27,18 +27,15 @@ group :development, :test do gem 'byebug' # rspec for testing - gem 'rspec-rails', '5.1.2' + gem 'rspec-rails', '8.1.0' # factory bot for generating models during testing - gem 'factory_bot_rails', '6.4.3' + gem 'factory_bot_rails', '6.5.1' end group :development do # The Listen gem listens to file modifications and notifies you about the changes. Used by Rails for auto reload in development. gem 'listen' - - # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' end group :production do @@ -47,13 +44,10 @@ group :production do end # ActiveModel serialization -gem 'active_model_serializers', '0.10.9' +gem 'active_model_serializers', '0.10.16' # CanCanCan for Authorization -gem 'cancancan', '2.3.0' +gem 'cancancan', '3.7.1' # Clone ActiveModel objects with relations -gem 'deep_cloneable', '3.2.0' - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'deep_cloneable', '3.2.2' diff --git a/Gemfile.lock b/Gemfile.lock index 6c3276c..fbda3d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,204 +1,305 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.8.1) - actionpack (= 5.2.8.1) + action_text-trix (2.1.19) + railties + actioncable (8.1.4.1) + actionpack (= 8.1.4.1) + activesupport (= 8.1.4.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.8.1) - actionview (= 5.2.8.1) - activesupport (= 5.2.8.1) - rack (~> 2.0, >= 2.0.8) + zeitwerk (~> 2.6) + actionmailbox (8.1.4.1) + actionpack (= 8.1.4.1) + activejob (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) + mail (>= 2.8.0) + actionmailer (8.1.4.1) + actionpack (= 8.1.4.1) + actionview (= 8.1.4.1) + activejob (= 8.1.4.1) + activesupport (= 8.1.4.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.1.4.1) + actionview (= 8.1.4.1) + activesupport (= 8.1.4.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8.1) - activesupport (= 5.2.8.1) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.1.4.1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.1.4.1) + activesupport (= 8.1.4.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - active_model_serializers (0.10.9) - actionpack (>= 4.1, < 6) - activemodel (>= 4.1, < 6) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6, >= 1.7.2) + active_model_serializers (0.10.16) + actionpack (>= 4.1) + activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (5.2.8.1) - activesupport (= 5.2.8.1) + activejob (8.1.4.1) + activesupport (= 8.1.4.1) globalid (>= 0.3.6) - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activestorage (5.2.8.1) - actionpack (= 5.2.8.1) - activerecord (= 5.2.8.1) - marcel (~> 1.0.0) - activesupport (5.2.8.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - bootsnap (1.18.3) - msgpack (~> 1.2) - builder (3.2.4) - byebug (11.1.3) - cancancan (2.3.0) + activemodel (8.1.4.1) + activesupport (= 8.1.4.1) + activerecord (8.1.4.1) + activemodel (= 8.1.4.1) + activesupport (= 8.1.4.1) + timeout (>= 0.4.0) + activestorage (8.1.4.1) + actionpack (= 8.1.4.1) + activejob (= 8.1.4.1) + activerecord (= 8.1.4.1) + activesupport (= 8.1.4.1) + marcel (~> 1.0) + activesupport (8.1.4.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + base64 (0.3.0) + bigdecimal (4.1.3) + bootsnap (1.26.1) + msgpack (~> 1.5) + builder (3.3.0) + byebug (13.0.0) + reline (>= 0.6.0) + cancancan (3.7.1) case_transform (0.2) activesupport - concurrent-ruby (1.2.3) - crass (1.0.6) - date (3.3.4) - deep_cloneable (3.2.0) - activerecord (>= 3.1.0, < 8) - diff-lcs (1.5.1) - erubi (1.12.0) - factory_bot (6.4.5) - activesupport (>= 5.0.0) - factory_bot_rails (6.4.3) - factory_bot (~> 6.4) - railties (>= 5.0.0) - ffi (1.16.3) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.14.4) + concurrent-ruby (1.3.8) + connection_pool (3.0.3) + crass (1.0.8) + date (3.6.0) + deep_cloneable (3.2.2) + activerecord (>= 3.1.0, < 9) + diff-lcs (1.6.2) + drb (2.2.3) + erb (6.0.7) + erubi (1.13.1) + factory_bot (6.6.0) + activesupport (>= 6.1.0) + factory_bot_rails (6.5.1) + factory_bot (~> 6.5) + railties (>= 6.1.0) + ffi (1.17.4) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-aarch64-linux-musl) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.4-x86_64-linux-musl) + globalid (1.4.0) + activesupport (>= 6.1) + i18n (1.15.2) concurrent-ruby (~> 1.0) + io-console (0.9.5) + irb (1.19.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (3.1.0) jsonapi-renderer (0.2.2) - listen (3.9.0) + listen (3.10.1) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.22.0) + logger (1.7.0) + loofah (2.25.3) crass (~> 1.0.2) - nokogiri (>= 1.12.0) - mail (2.8.1) + nokogiri (>= 1.19.5) + mail (2.9.1) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.4) - method_source (1.0.0) + marcel (1.2.1) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.22.3) - msgpack (1.7.2) - mysql2 (0.5.6) - net-imap (0.4.10) + mini_portile2 (2.8.9) + minitest (6.1.0) + drb (~> 2.0) + prism (>= 1.5, < 3) + msgpack (1.8.7) + mysql2 (0.5.7) + bigdecimal + net-imap (0.6.8) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.2) + net-protocol (0.4.0) timeout - net-smtp (0.5.0) + net-smtp (0.5.2) net-protocol - newrelic_rpm (9.8.0) - nio4r (2.7.1) - nokogiri (1.15.6) + newrelic_rpm (10.9.1) + logger + nio4r (2.7.5) + nokogiri (1.19.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - puma (6.4.2) + nokogiri (1.19.7-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.7-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.19.7-arm64-darwin) + racc (~> 1.4) + nokogiri (1.19.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.19.7-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.19.7-x86_64-linux-musl) + racc (~> 1.4) + pp (0.6.4) + prettyprint + prettyprint (0.2.1) + prism (2.1.0) + prism (2.1.0-aarch64-linux-gnu) + prism (2.1.0-aarch64-linux-musl) + prism (2.1.0-arm64-darwin) + prism (2.1.0-x86_64-darwin) + prism (2.1.0-x86_64-linux-gnu) + prism (2.1.0-x86_64-linux-musl) + puma (8.1.2) nio4r (~> 2.0) - racc (1.7.3) - rack (2.2.9) - rack-cors (2.0.2) - rack (>= 2.0.0) - rack-test (2.1.0) + racc (1.8.1) + rack (3.2.8) + rack-cors (3.0.0) + logger + rack (>= 3.0.14) + rack-session (2.1.2) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.3.0) rack (>= 1.3) - rails (5.2.8.1) - actioncable (= 5.2.8.1) - actionmailer (= 5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - activemodel (= 5.2.8.1) - activerecord (= 5.2.8.1) - activestorage (= 5.2.8.1) - activesupport (= 5.2.8.1) - bundler (>= 1.3.0) - railties (= 5.2.8.1) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.2.0) + rackup (2.3.1) + rack (>= 3) + rails (8.1.4.1) + actioncable (= 8.1.4.1) + actionmailbox (= 8.1.4.1) + actionmailer (= 8.1.4.1) + actionpack (= 8.1.4.1) + actiontext (= 8.1.4.1) + actionview (= 8.1.4.1) + activejob (= 8.1.4.1) + activemodel (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) + bundler (>= 1.15.0) + railties (= 8.1.4.1) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) - loofah (~> 2.21) - nokogiri (~> 1.14) - railties (5.2.8.1) - actionpack (= 5.2.8.1) - activesupport (= 5.2.8.1) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.1.0) + rails-html-sanitizer (1.7.2) + loofah (~> 2.25, >= 2.25.3) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.4.1) + actionpack (= 8.1.4.1) + activesupport (= 8.1.4.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rake (13.4.2) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rspec-core (3.13.0) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort + rdoc (8.1.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort + reline (0.7.0) + io-console (~> 0.5) + rspec-core (3.13.7) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.9) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.13.1) - spring (4.1.3) - sprockets (4.2.1) + rspec-rails (8.1.0) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (>= 3.13.0, < 5.0.0) + rspec-expectations (>= 3.13.0, < 5.0.0) + rspec-mocks (>= 3.13.0, < 5.0.0) + rspec-support (>= 3.13.0, < 5.0.0) + rspec-support (3.13.8) + securerandom (0.4.1) + thor (1.5.0) + timeout (0.6.1) + tsort (0.2.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - thor (1.3.1) - thread_safe (0.3.6) - timeout (0.4.1) - tzinfo (1.2.11) - thread_safe (~> 0.1) - websocket-driver (0.7.6) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) + uri (1.1.2) + useragent (0.16.11) + websocket-driver (0.9.0) + base64 + websocket-extensions (>= 0.2.0) + websocket-extensions (0.2.0) + zeitwerk (2.8.3) PLATFORMS + aarch64-linux + aarch64-linux-musl + arm64-darwin ruby + x86_64-darwin + x86_64-linux + x86_64-linux-musl DEPENDENCIES - active_model_serializers (= 0.10.9) + active_model_serializers (= 0.10.16) bootsnap (>= 1.1.0) byebug - cancancan (= 2.3.0) - deep_cloneable (= 3.2.0) - factory_bot_rails (= 6.4.3) + cancancan (= 3.7.1) + deep_cloneable (= 3.2.2) + factory_bot_rails (= 6.5.1) listen mysql2 newrelic_rpm puma rack-cors - rails (= 5.2.8.1) - rspec-rails (= 5.1.2) - spring - tzinfo-data + rails (= 8.1.4.1) + rspec-rails (= 8.1.0) RUBY VERSION - ruby 2.7.8p225 + ruby 3.4.13 BUNDLED WITH - 2.1.4 + 4.1.0 diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb deleted file mode 100644 index 438c841..0000000 --- a/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading. -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb deleted file mode 100644 index 965046f..0000000 --- a/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading. -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb deleted file mode 100644 index a009ace..0000000 --- a/app/jobs/application_job.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApplicationJob < ActiveJob::Base -end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb deleted file mode 100644 index 286b223..0000000 --- a/app/mailers/application_mailer.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' - layout 'mailer' -end diff --git a/app/models/session.rb b/app/models/session.rb index f55a103..f810a44 100644 --- a/app/models/session.rb +++ b/app/models/session.rb @@ -1,4 +1,5 @@ class Session + extend ActiveModel::Naming include ActiveModel::Serialization attr_accessor :username diff --git a/bin/spring b/bin/spring deleted file mode 100755 index 62ec28f..0000000 --- a/bin/spring +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads spring without using Bundler, in order to be fast. -# It gets overwritten when you run the `spring binstub` command. - -unless defined?(Spring) - require 'rubygems' - require 'bundler' - - if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) - Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq } - gem 'spring', match[1] - require 'spring/binstub' - end -end diff --git a/config/application.rb b/config/application.rb index 4fd6b0c..08f550e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -3,15 +3,10 @@ require "rails" # Pick the frameworks you want: require "active_model/railtie" -require "active_job/railtie" require "active_record/railtie" -require "active_storage/engine" require "action_controller/railtie" -require "action_mailer/railtie" require "action_view/railtie" -require "action_cable/engine" # require "sprockets/railtie" -require "rails/test_unit/railtie" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -20,7 +15,7 @@ module Anrop class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.1 + config.load_defaults 8.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/config/cable.yml b/config/cable.yml deleted file mode 100644 index adb3ec3..0000000 --- a/config/cable.yml +++ /dev/null @@ -1,10 +0,0 @@ -development: - adapter: async - -test: - adapter: async - -production: - adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: anrop_production diff --git a/config/environments/development.rb b/config/environments/development.rb index d52ec9e..5251b17 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -4,7 +4,7 @@ # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false @@ -19,7 +19,7 @@ config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.to_i}" + 'Cache-Control' => "public, max-age=172800" } else config.action_controller.perform_caching = false @@ -27,14 +27,6 @@ config.cache_store = :null_store end - # Store uploaded files on the local file system (see config/storage.yml for options) - config.active_storage.service = :local - - # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false - - config.action_mailer.perform_caching = false - # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/config/environments/production.rb b/config/environments/production.rb index 58b8935..7e447f6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -29,14 +29,6 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options) - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true @@ -50,16 +42,6 @@ # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "anrop_#{Rails.env}" - - config.action_mailer.perform_caching = false - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true diff --git a/config/environments/test.rb b/config/environments/test.rb index 0a38fd3..172dd2c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -5,7 +5,7 @@ # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.enable_reloading = false # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that @@ -15,7 +15,7 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + 'Cache-Control' => "public, max-age=3600" } # Show full error reports and disable caching. @@ -28,16 +28,6 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory - config.active_storage.service = :test - - config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb deleted file mode 100644 index 89d2efa..0000000 --- a/config/initializers/application_controller_renderer.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# ActiveSupport::Reloader.to_prepare do -# ApplicationController.renderer.defaults.merge!( -# http_host: 'example.org', -# https: false -# ) -# end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb deleted file mode 100644 index 9c7a620..0000000 --- a/config/initializers/assets.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -# Rails.application.config.assets.version = '1.0' - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/config/redis/cable.yml b/config/redis/cable.yml deleted file mode 100644 index 0176be2..0000000 --- a/config/redis/cable.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Action Cable uses Redis to administer connections, channels, and sending/receiving messages over the WebSocket. -production: - url: redis://localhost:6379/1 - -development: - url: redis://localhost:6379/2 - -test: - url: redis://localhost:6379/3 diff --git a/config/secrets.yml b/config/secrets.yml deleted file mode 100644 index abd4ce1..0000000 --- a/config/secrets.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rails secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -# Shared secrets are available across all environments. - -# shared: -# api_key: a1B2c3D4e5F6 - -# Environmental secrets are only available for that specific environment. - -development: - secret_key_base: 61d2c5cfb8bc3266902afdb02b31025b29b1439dd378de972a87b9ece167e078fb9e6b5b27ec2e67b3b747999ad1574c21b87dce6bf5048ce6d816d5b9133446 - -test: - secret_key_base: a7bc0b4d0735f840d2bac21e80634d20a213e5da26922a929d55a574af46c52040b306fd5de10d811c5171497c597cf2c35fcabdcb21f5af6403504104b03d2a - -# Do not keep production secrets in the unencrypted secrets file. -# Instead, either read values from the environment. -# Or, use `bin/rails secrets:setup` to configure encrypted secrets -# and move the `production:` environment over there. - -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/config/spring.rb b/config/spring.rb deleted file mode 100644 index 9fa7863..0000000 --- a/config/spring.rb +++ /dev/null @@ -1,6 +0,0 @@ -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } diff --git a/config/storage.yml b/config/storage.yml deleted file mode 100644 index d32f76e..0000000 --- a/config/storage.yml +++ /dev/null @@ -1,34 +0,0 @@ -test: - service: Disk - root: <%= Rails.root.join("tmp/storage") %> - -local: - service: Disk - root: <%= Rails.root.join("storage") %> - -# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) -# amazon: -# service: S3 -# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> -# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> -# region: us-east-1 -# bucket: your_own_bucket - -# Remember not to checkin your GCS keyfile to a repository -# google: -# service: GCS -# project: your_project -# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> -# bucket: your_own_bucket - -# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) -# microsoft: -# service: AzureStorage -# storage_account_name: your_account_name -# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> -# container: your_container_name - -# mirror: -# service: Mirror -# primary: local -# mirrors: [ amazon, google, microsoft ] diff --git a/db/schema.rb b/db/schema.rb index 4c4a230..d8a92e6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -17,7 +17,7 @@ t.string "admin_image", limit: 50, default: "", null: false t.string "admin_title", limit: 50, default: "", null: false t.string "admin_link", limit: 100, default: "reserved", null: false - t.boolean "admin_page", default: true, null: false, unsigned: true + t.boolean "admin_page", default: true, null: false end create_table "fusion7_admin_resetlog", primary_key: "reset_id", id: :integer, limit: 3, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| @@ -48,13 +48,13 @@ t.string "article_subject", limit: 200, default: "", null: false t.text "article_snippet", null: false t.text "article_article", null: false - t.boolean "article_draft", default: false, null: false, unsigned: true + t.boolean "article_draft", default: false, null: false t.string "article_breaks", limit: 1, default: "", null: false t.integer "article_name", limit: 2, default: 1, null: false, unsigned: true t.integer "article_datestamp", default: 0, null: false, unsigned: true t.integer "article_reads", limit: 3, default: 0, unsigned: true - t.boolean "article_allow_comments", default: true, null: false, unsigned: true - t.boolean "article_allow_ratings", default: true, null: false, unsigned: true + t.boolean "article_allow_comments", default: true, null: false + t.boolean "article_allow_ratings", default: true, null: false t.index ["article_cat"], name: "article_cat" t.index ["article_datestamp"], name: "article_datestamp" t.index ["article_reads"], name: "article_reads" @@ -69,7 +69,7 @@ create_table "fusion7_blacklist", primary_key: "blacklist_id", id: :integer, limit: 2, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.integer "blacklist_user_id", limit: 3, default: 0, null: false, unsigned: true t.string "blacklist_ip", limit: 45, default: "", null: false - t.boolean "blacklist_ip_type", default: true, null: false, unsigned: true + t.boolean "blacklist_ip_type", default: true, null: false t.string "blacklist_email", limit: 100, default: "", null: false t.text "blacklist_reason", null: false t.integer "blacklist_datestamp", default: 0, null: false, unsigned: true @@ -79,7 +79,7 @@ create_table "fusion7_captcha", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.integer "captcha_datestamp", default: 0, null: false, unsigned: true t.string "captcha_ip", limit: 45, default: "", null: false - t.boolean "captcha_ip_type", default: true, null: false, unsigned: true + t.boolean "captcha_ip_type", default: true, null: false t.string "captcha_encode", limit: 32, default: "", null: false t.string "captcha_string", limit: 15, default: "", null: false t.index ["captcha_datestamp"], name: "captcha_datestamp" @@ -92,8 +92,8 @@ t.text "comment_message", null: false t.integer "comment_datestamp", default: 0, null: false, unsigned: true t.string "comment_ip", limit: 45, default: "", null: false - t.boolean "comment_ip_type", default: true, null: false, unsigned: true - t.boolean "comment_hidden", default: false, null: false, unsigned: true + t.boolean "comment_ip_type", default: true, null: false + t.boolean "comment_hidden", default: false, null: false t.index ["comment_datestamp"], name: "comment_datestamp" end @@ -101,8 +101,8 @@ t.string "page_title", limit: 200, default: "", null: false t.integer "page_access", limit: 1, default: 0, null: false, unsigned: true t.text "page_content", null: false - t.boolean "page_allow_comments", default: false, null: false, unsigned: true - t.boolean "page_allow_ratings", default: false, null: false, unsigned: true + t.boolean "page_allow_comments", default: false, null: false + t.boolean "page_allow_ratings", default: false, null: false end create_table "fusion7_download_cats", primary_key: "download_cat_id", id: :integer, limit: 3, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| @@ -130,8 +130,8 @@ t.string "download_filesize", limit: 20, default: "", null: false t.integer "download_datestamp", default: 0, null: false, unsigned: true t.integer "download_count", limit: 2, default: 0, null: false, unsigned: true - t.boolean "download_allow_comments", default: false, null: false, unsigned: true - t.boolean "download_allow_ratings", default: false, null: false, unsigned: true + t.boolean "download_allow_comments", default: false, null: false + t.boolean "download_allow_ratings", default: false, null: false t.index ["download_datestamp"], name: "download_datestamp" end @@ -151,7 +151,7 @@ t.string "error_page", limit: 200, null: false t.integer "error_user_level", limit: 2, null: false t.string "error_user_ip", limit: 45, default: "", null: false - t.boolean "error_user_ip_type", default: true, null: false, unsigned: true + t.boolean "error_user_ip_type", default: true, null: false t.boolean "error_status", default: false, null: false t.integer "error_timestamp", null: false end @@ -169,7 +169,7 @@ create_table "fusion7_flood_control", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.string "flood_ip", limit: 45, default: "", null: false - t.boolean "flood_ip_type", default: true, null: false, unsigned: true + t.boolean "flood_ip_type", default: true, null: false t.integer "flood_timestamp", default: 0, null: false, unsigned: true t.index ["flood_timestamp"], name: "flood_timestamp" end @@ -195,7 +195,7 @@ t.integer "thread_id", limit: 3, default: 0, null: false, unsigned: true t.integer "forum_vote_user_id", limit: 3, default: 0, null: false, unsigned: true t.string "forum_vote_user_ip", limit: 45, default: "", null: false - t.boolean "forum_vote_user_ip_type", default: true, null: false, unsigned: true + t.boolean "forum_vote_user_ip_type", default: true, null: false t.index ["thread_id", "forum_vote_user_id"], name: "thread_id" end @@ -212,7 +212,7 @@ t.string "rank_title", limit: 100, default: "", null: false t.string "rank_image", limit: 100, default: "", null: false t.integer "rank_posts", default: 0, null: false, unsigned: true - t.boolean "rank_type", default: false, null: false, unsigned: true + t.boolean "rank_type", default: false, null: false t.integer "rank_apply", limit: 2, default: 101, null: false, unsigned: true end @@ -233,7 +233,7 @@ t.integer "forum_postcount", limit: 3, default: 0, null: false, unsigned: true t.integer "forum_threadcount", limit: 3, default: 0, null: false, unsigned: true t.integer "forum_lastuser", limit: 2, default: 0, null: false, unsigned: true - t.boolean "forum_merge", default: false, null: false, unsigned: true + t.boolean "forum_merge", default: false, null: false t.index ["forum_lastpost"], name: "forum_lastpost" t.index ["forum_order"], name: "forum_order" t.index ["forum_postcount"], name: "forum_postcount" @@ -257,15 +257,15 @@ t.string "message_subject", limit: 100, default: "", null: false t.text "message_message", null: false t.string "message_smileys", limit: 1, default: "", null: false - t.boolean "message_read", default: false, null: false, unsigned: true + t.boolean "message_read", default: false, null: false t.integer "message_datestamp", default: 0, null: false, unsigned: true - t.boolean "message_folder", default: false, null: false, unsigned: true + t.boolean "message_folder", default: false, null: false t.index ["message_datestamp"], name: "message_datestamp" end create_table "fusion7_messages_options", primary_key: "user_id", id: :integer, limit: 3, default: 0, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| - t.boolean "pm_email_notify", default: false, null: false, unsigned: true - t.boolean "pm_save_sent", default: false, null: false, unsigned: true + t.boolean "pm_email_notify", default: false, null: false + t.boolean "pm_save_sent", default: false, null: false t.integer "pm_inbox", limit: 2, default: 0, null: false, unsigned: true t.integer "pm_savebox", limit: 2, default: 0, null: false, unsigned: true t.integer "pm_sentbox", limit: 2, default: 0, null: false, unsigned: true @@ -307,10 +307,10 @@ t.integer "news_end", default: 0, null: false, unsigned: true t.integer "news_visibility", limit: 1, default: 0, null: false, unsigned: true t.integer "news_reads", limit: 3, default: 0, unsigned: true - t.boolean "news_draft", default: false, null: false, unsigned: true - t.boolean "news_sticky", default: false, null: false, unsigned: true - t.boolean "news_allow_comments", default: true, null: false, unsigned: true - t.boolean "news_allow_ratings", default: true, null: false, unsigned: true + t.boolean "news_draft", default: false, null: false + t.boolean "news_sticky", default: false, null: false + t.boolean "news_allow_comments", default: true, null: false + t.boolean "news_allow_ratings", default: true, null: false t.index ["news_datestamp"], name: "news_datestamp" t.index ["news_reads"], name: "news_reads" end @@ -323,7 +323,7 @@ create_table "fusion7_online", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.string "online_user", limit: 50, default: "", null: false t.string "online_ip", limit: 45, default: "", null: false - t.boolean "online_ip_type", default: true, null: false, unsigned: true + t.boolean "online_ip_type", default: true, null: false t.integer "online_lastactive", default: 0, null: false, unsigned: true end @@ -374,7 +374,7 @@ t.integer "group_id", null: false, unsigned: true t.string "slot_title", limit: 150, default: "", null: false t.integer "user_id", unsigned: true - t.boolean "slot_locked", default: false, null: false, unsigned: true + t.boolean "slot_locked", default: false, null: false t.integer "slot_order", default: 0, null: false t.timestamp "slot_updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false t.index ["group_id"], name: "group_id" @@ -392,14 +392,14 @@ t.string "panel_name", limit: 100, default: "", null: false t.string "panel_filename", limit: 100, default: "", null: false t.text "panel_content", null: false - t.boolean "panel_side", default: true, null: false, unsigned: true + t.boolean "panel_side", default: true, null: false t.integer "panel_order", limit: 2, default: 0, null: false, unsigned: true t.string "panel_type", limit: 20, default: "", null: false t.integer "panel_access", limit: 1, default: 0, null: false, unsigned: true - t.boolean "panel_display", default: false, null: false, unsigned: true - t.boolean "panel_status", default: false, null: false, unsigned: true + t.boolean "panel_display", default: false, null: false + t.boolean "panel_status", default: false, null: false t.text "panel_url_list", null: false - t.boolean "panel_restriction", default: false, null: false, unsigned: true + t.boolean "panel_restriction", default: false, null: false t.index ["panel_order"], name: "panel_order" end @@ -426,8 +426,8 @@ t.integer "photo_user", limit: 2, default: 0, null: false, unsigned: true t.integer "photo_views", limit: 2, default: 0, null: false, unsigned: true t.integer "photo_order", limit: 2, default: 0, null: false, unsigned: true - t.boolean "photo_allow_comments", default: true, null: false, unsigned: true - t.boolean "photo_allow_ratings", default: true, null: false, unsigned: true + t.boolean "photo_allow_comments", default: true, null: false + t.boolean "photo_allow_ratings", default: true, null: false t.index ["photo_datestamp"], name: "photo_datestamp" t.index ["photo_order"], name: "photo_order" end @@ -458,17 +458,17 @@ t.integer "forum_id", limit: 3, default: 0, unsigned: true t.integer "thread_id", limit: 3, default: 0, unsigned: true t.text "post_message", null: false - t.boolean "post_showsig", default: false, null: false, unsigned: true - t.boolean "post_smileys", default: true, null: false, unsigned: true + t.boolean "post_showsig", default: false, null: false + t.boolean "post_smileys", default: true, null: false t.integer "post_author", limit: 2, default: 0, null: false, unsigned: true t.integer "post_datestamp", default: 0, null: false, unsigned: true t.string "post_ip", limit: 45, default: "", null: false - t.boolean "post_ip_type", default: true, null: false, unsigned: true + t.boolean "post_ip_type", default: true, null: false t.integer "post_edituser", limit: 2, default: 0, null: false, unsigned: true t.integer "post_edittime", default: 0, null: false, unsigned: true t.text "post_editreason", null: false - t.boolean "post_hidden", default: false, null: false, unsigned: true - t.boolean "post_locked", default: false, null: false, unsigned: true + t.boolean "post_hidden", default: false, null: false + t.boolean "post_locked", default: false, null: false t.index ["post_datestamp"], name: "post_datestamp" t.index ["post_datestamp"], name: "post_datestamp_2" t.index ["thread_id"], name: "thread_id" @@ -478,10 +478,10 @@ t.integer "rating_item_id", limit: 3, default: 0, unsigned: true t.string "rating_type", limit: 1, default: "", null: false t.integer "rating_user", limit: 2, default: 0, null: false, unsigned: true - t.boolean "rating_vote", default: false, null: false, unsigned: true + t.boolean "rating_vote", default: false, null: false t.integer "rating_datestamp", default: 0, null: false, unsigned: true t.string "rating_ip", limit: 45, default: "", null: false - t.boolean "rating_ip_type", default: true, null: false, unsigned: true + t.boolean "rating_ip_type", default: true, null: false end create_table "fusion7_settings", primary_key: "settings_name", id: :string, limit: 200, default: "", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| @@ -498,8 +498,8 @@ t.string "shout_message", default: "", null: false t.integer "shout_datestamp", default: 0, null: false, unsigned: true t.string "shout_ip", limit: 45, default: "", null: false - t.boolean "shout_ip_type", default: true, null: false, unsigned: true - t.boolean "shout_hidden", default: false, null: false, unsigned: true + t.boolean "shout_ip_type", default: true, null: false + t.boolean "shout_hidden", default: false, null: false t.index ["shout_datestamp"], name: "shout_datestamp" end @@ -507,83 +507,83 @@ t.string "link_name", limit: 100, default: "", null: false t.string "link_url", limit: 200, default: "", null: false t.integer "link_visibility", limit: 1, default: 0, null: false, unsigned: true - t.boolean "link_position", default: true, null: false, unsigned: true - t.boolean "link_window", default: false, null: false, unsigned: true + t.boolean "link_position", default: true, null: false + t.boolean "link_window", default: false, null: false t.integer "link_order", limit: 2, default: 0, null: false, unsigned: true end create_table "fusion7_sitemapxml", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.integer "update_interval", limit: 3, default: 86400, null: false, unsigned: true t.string "site_url", limit: 200, default: "", null: false - t.boolean "news_enabled", default: true, null: false, unsigned: true - t.boolean "news_changefreq", default: false, null: false, unsigned: true + t.boolean "news_enabled", default: true, null: false + t.boolean "news_changefreq", default: false, null: false t.string "news_priority", limit: 3, default: "0.6", null: false - t.boolean "newscats_enabled", default: true, null: false, unsigned: true - t.boolean "newscats_changefreq", default: true, null: false, unsigned: true + t.boolean "newscats_enabled", default: true, null: false + t.boolean "newscats_changefreq", default: true, null: false t.string "newscats_priority", limit: 3, default: "0.2", null: false - t.boolean "articlecats_enabled", default: true, null: false, unsigned: true - t.boolean "articlecats_changefreq", default: false, null: false, unsigned: true + t.boolean "articlecats_enabled", default: true, null: false + t.boolean "articlecats_changefreq", default: false, null: false t.string "articlecats_priority", limit: 3, default: "0.2", null: false - t.boolean "articles_enabled", default: true, null: false, unsigned: true - t.boolean "articles_changefreq", default: true, null: false, unsigned: true + t.boolean "articles_enabled", default: true, null: false + t.boolean "articles_changefreq", default: true, null: false t.string "articles_priority", limit: 3, default: "0.5", null: false - t.boolean "profiles_enabled", default: true, null: false, unsigned: true - t.boolean "profiles_changefreq", default: true, null: false, unsigned: true + t.boolean "profiles_enabled", default: true, null: false + t.boolean "profiles_changefreq", default: true, null: false t.string "profiles_priority", limit: 3, default: "0.1", null: false - t.boolean "photoalbums_enabled", default: true, null: false, unsigned: true - t.boolean "photoalbums_changefreq", default: false, null: false, unsigned: true + t.boolean "photoalbums_enabled", default: true, null: false + t.boolean "photoalbums_changefreq", default: false, null: false t.string "photoalbums_priority", limit: 3, default: "0.2", null: false - t.boolean "photos_enabled", default: true, null: false, unsigned: true - t.boolean "photos_changefreq", default: false, null: false, unsigned: true + t.boolean "photos_enabled", default: true, null: false + t.boolean "photos_changefreq", default: false, null: false t.string "photos_priority", limit: 3, default: "0.3", null: false - t.boolean "custompages_enabled", default: true, null: false, unsigned: true - t.boolean "custompages_changefreq", default: true, null: false, unsigned: true + t.boolean "custompages_enabled", default: true, null: false + t.boolean "custompages_changefreq", default: true, null: false t.string "custompages_priority", limit: 3, default: "0.3", null: false - t.boolean "faqcats_enabled", default: true, null: false, unsigned: true - t.boolean "faqcats_changefreq", default: true, null: false, unsigned: true + t.boolean "faqcats_enabled", default: true, null: false + t.boolean "faqcats_changefreq", default: true, null: false t.string "faqcats_priority", limit: 3, default: "0.3", null: false - t.boolean "downloadcats_enabled", default: true, null: false, unsigned: true - t.boolean "downloadcats_changefreq", default: true, null: false, unsigned: true + t.boolean "downloadcats_enabled", default: true, null: false + t.boolean "downloadcats_changefreq", default: true, null: false t.string "downloadcats_priority", limit: 3, default: "0.3", null: false - t.boolean "downloads_enabled", default: true, null: false, unsigned: true - t.boolean "downloads_changefreq", default: true, null: false, unsigned: true + t.boolean "downloads_enabled", default: true, null: false + t.boolean "downloads_changefreq", default: true, null: false t.string "downloads_priority", limit: 3, default: "0.4", null: false - t.boolean "weblinkcats_enabled", default: true, null: false, unsigned: true - t.boolean "weblinkcats_changefreq", default: true, null: false, unsigned: true + t.boolean "weblinkcats_enabled", default: true, null: false + t.boolean "weblinkcats_changefreq", default: true, null: false t.string "weblinkcats_priority", limit: 3, default: "0.3", null: false - t.boolean "forums_enabled", default: true, null: false, unsigned: true - t.boolean "forums_changefreq", default: true, null: false, unsigned: true + t.boolean "forums_enabled", default: true, null: false + t.boolean "forums_changefreq", default: true, null: false t.string "forums_priority", limit: 3, default: "0.4", null: false - t.boolean "threads_enabled", default: true, null: false, unsigned: true - t.boolean "threads_changefreq", default: false, null: false, unsigned: true + t.boolean "threads_enabled", default: true, null: false + t.boolean "threads_changefreq", default: false, null: false t.string "threads_priority", limit: 3, default: "0.6", null: false t.integer "threads_limit", limit: 3, default: 0, null: false, unsigned: true - t.boolean "kroaxcats_enabled", default: false, null: false, unsigned: true - t.boolean "kroaxcats_changefreq", default: false, null: false, unsigned: true + t.boolean "kroaxcats_enabled", default: false, null: false + t.boolean "kroaxcats_changefreq", default: false, null: false t.string "kroaxcats_priority", limit: 3, default: "0.1", null: false - t.boolean "kroaxvideos_enabled", default: false, null: false, unsigned: true - t.boolean "kroaxvideos_changefreq", default: false, null: false, unsigned: true + t.boolean "kroaxvideos_enabled", default: false, null: false + t.boolean "kroaxvideos_changefreq", default: false, null: false t.string "kroaxvideos_priority", limit: 3, default: "0.3", null: false - t.boolean "varcadecats_enabled", default: false, null: false, unsigned: true - t.boolean "varcadecats_changefreq", default: true, null: false, unsigned: true + t.boolean "varcadecats_enabled", default: false, null: false + t.boolean "varcadecats_changefreq", default: true, null: false t.string "varcadecats_priority", limit: 3, default: "0.3", null: false - t.boolean "varcadegames_enabled", default: false, null: false, unsigned: true - t.boolean "varcadegames_changefreq", default: true, null: false, unsigned: true + t.boolean "varcadegames_enabled", default: false, null: false + t.boolean "varcadegames_changefreq", default: true, null: false t.string "varcadegames_priority", limit: 3, default: "0.3", null: false - t.boolean "pdpcats_enabled", default: false, null: false, unsigned: true - t.boolean "pdpcats_changefreq", default: true, null: false, unsigned: true + t.boolean "pdpcats_enabled", default: false, null: false + t.boolean "pdpcats_changefreq", default: true, null: false t.string "pdpcats_priority", limit: 3, default: "0.2", null: false - t.boolean "pdpdownloads_enabled", default: false, null: false, unsigned: true - t.boolean "pdpdownloads_changefreq", default: true, null: false, unsigned: true + t.boolean "pdpdownloads_enabled", default: false, null: false + t.boolean "pdpdownloads_changefreq", default: true, null: false t.string "pdpdownloads_priority", limit: 3, default: "0.3", null: false - t.boolean "tiblogsystem_enabled", default: false, null: false, unsigned: true - t.boolean "tiblogsystem_changefreq", default: true, null: false, unsigned: true + t.boolean "tiblogsystem_enabled", default: false, null: false + t.boolean "tiblogsystem_changefreq", default: true, null: false t.string "tiblogsystem_priority", limit: 3, default: "0.3", null: false end create_table "fusion7_sitemapxml_customlinks", primary_key: "link_id", id: :integer, limit: 3, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.text "link_url", null: false - t.boolean "link_frequency", default: true, null: false, unsigned: true + t.boolean "link_frequency", default: true, null: false t.string "link_priority", limit: 3, default: "0.4", null: false end @@ -604,7 +604,7 @@ t.integer "suspended_user", limit: 3, null: false, unsigned: true t.integer "suspending_admin", limit: 3, default: 1, null: false, unsigned: true t.string "suspend_ip", limit: 45, default: "", null: false - t.boolean "suspend_ip_type", default: true, null: false, unsigned: true + t.boolean "suspend_ip_type", default: true, null: false t.integer "suspend_date", default: 0, null: false t.text "suspend_reason", null: false t.boolean "suspend_type", default: false, null: false @@ -612,14 +612,14 @@ t.text "reinstate_reason", null: false t.integer "reinstate_date", default: 0, null: false t.string "reinstate_ip", limit: 45, default: "", null: false - t.boolean "reinstate_ip_type", default: true, null: false, unsigned: true + t.boolean "reinstate_ip_type", default: true, null: false end create_table "fusion7_thread_notify", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.integer "thread_id", limit: 3, default: 0, unsigned: true t.integer "notify_datestamp", default: 0, null: false, unsigned: true t.integer "notify_user", limit: 3, default: 0, unsigned: true - t.boolean "notify_status", default: true, null: false, unsigned: true + t.boolean "notify_status", default: true, null: false t.index ["notify_datestamp"], name: "notify_datestamp" end @@ -632,10 +632,10 @@ t.integer "thread_lastpostid", limit: 3, default: 0, null: false, unsigned: true t.integer "thread_postcount", limit: 2, default: 0, null: false, unsigned: true t.integer "thread_lastuser", limit: 2, default: 0, null: false, unsigned: true - t.boolean "thread_poll", default: false, null: false, unsigned: true - t.boolean "thread_sticky", default: false, null: false, unsigned: true - t.boolean "thread_locked", default: false, null: false, unsigned: true - t.boolean "thread_hidden", default: false, null: false, unsigned: true + t.boolean "thread_poll", default: false, null: false + t.boolean "thread_sticky", default: false, null: false + t.boolean "thread_locked", default: false, null: false + t.boolean "thread_hidden", default: false, null: false t.index ["thread_lastpost"], name: "thread_lastpost" t.index ["thread_postcount"], name: "thread_postcount" t.index ["thread_views"], name: "thread_views" @@ -649,9 +649,9 @@ create_table "fusion7_user_fields", primary_key: "field_id", id: :integer, limit: 3, unsigned: true, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.string "field_name", limit: 50, default: "", null: false t.integer "field_cat", limit: 3, default: 1, unsigned: true - t.boolean "field_required", default: false, null: false, unsigned: true - t.boolean "field_log", default: false, null: false, unsigned: true - t.boolean "field_registration", default: false, null: false, unsigned: true + t.boolean "field_required", default: false, null: false + t.boolean "field_log", default: false, null: false + t.boolean "field_registration", default: false, null: false t.integer "field_order", limit: 2, default: 0, null: false, unsigned: true t.index ["field_order"], name: "field_order" end @@ -680,7 +680,7 @@ t.string "user_admin_salt", limit: 40, null: false t.string "user_admin_password", limit: 64, null: false t.string "user_email", limit: 100, default: "", null: false - t.boolean "user_hide_email", default: true, null: false, unsigned: true + t.boolean "user_hide_email", default: true, null: false t.string "user_location", limit: 50, default: "", null: false t.date "user_birthdate", null: false t.string "user_aim", limit: 16, default: "", null: false @@ -697,11 +697,11 @@ t.integer "user_joined", default: 0, null: false, unsigned: true t.integer "user_lastvisit", default: 0, null: false, unsigned: true t.string "user_ip", limit: 45, default: "0.0.0.0", null: false - t.boolean "user_ip_type", default: true, null: false, unsigned: true + t.boolean "user_ip_type", default: true, null: false t.text "user_rights", null: false t.text "user_groups", null: false t.integer "user_level", limit: 1, default: 101, null: false, unsigned: true - t.boolean "user_status", default: false, null: false, unsigned: true + t.boolean "user_status", default: false, null: false t.integer "user_actiontime", default: 0, null: false, unsigned: true t.string "user_arma2_id", limit: 20, default: "", null: false t.string "user_arma2_nick", limit: 50, default: "", null: false diff --git a/docker-compose.yml b/docker-compose.yml index aef3d51..7a80255 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,10 @@ -version: '2' - services: rails: - build: . + build: + context: . + platforms: + - linux/amd64 + - linux/arm64 image: anrop/anrop-api environment: MYSQL_HOST: mysql @@ -17,7 +19,7 @@ services: volumes: - .:/anrop mysql: - image: mysql:5.5 + image: mariadb:10.11.19 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: anrop diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 4383429..b27d3ff 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -28,7 +28,7 @@ RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_paths = ["#{::Rails.root}/spec/fixtures"] # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false diff --git a/spec/support/json_helper.rb b/spec/support/json_helper.rb index 854c333..99de5a8 100644 --- a/spec/support/json_helper.rb +++ b/spec/support/json_helper.rb @@ -1,7 +1,7 @@ module JsonHelper def compare_response_body_with_model(response, model) - model_json = JSON.parse(ActiveModelSerializers::SerializableResource.new(model).to_json, {symbolize_names: :true}) - body_json = JSON.parse(response.body, {symbolize_names: :true}) + model_json = JSON.parse(ActiveModelSerializers::SerializableResource.new(model).to_json, symbolize_names: true) + body_json = JSON.parse(response.body, symbolize_names: true) expect(body_json).to eq(model_json) end end diff --git a/test/controllers/.keep b/test/controllers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/fixtures/.keep b/test/fixtures/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/fixtures/files/.keep b/test/fixtures/files/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/integration/.keep b/test/integration/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/mailers/.keep b/test/mailers/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/models/.keep b/test/models/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index 92e39b2..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,10 +0,0 @@ -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. - fixtures :all - - # Add more helper methods to be used by all tests here... -end