diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 00000000..0ec3875e --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,14 @@ +glob: "**/*.{html}{+*,}.erb" +exclude: + - '**/vendor/**/*' +EnableDefaultLinters: true +linters: + PartialInstanceVariable: + enabled: true + ErbSafety: + enabled: true + Rubocop: + enabled: false + rubocop_config: + inherit_from: + - .rubocop.yml \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..6bf660ba --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,35 @@ +require: + - rubocop-capybara + - rubocop-performance + - rubocop-rails + - rubocop-rspec + - rubocop-rspec_rails + - standard + +inherit_gem: + standard: config/base.yml + +AllCops: + TargetRubyVersion: 3.3.3 + NewCops: enable + Exclude: + - "bin/**" + - "db/schema.rb" + - "vendor/**/*" + +RSpec/ExampleLength: + Enabled: false +RSpec/MultipleExpectations: + Enabled: false +RSpec/LetSetup: + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpecRails/InferredSpecType: + Enabled: false +Bundler/OrderedGems: + Enabled: true +Rails/HasAndBelongsToMany: + Enabled: false +Rails/UnknownEnv: + Environments: ["development", "test", "staging", "production"] diff --git a/Gemfile b/Gemfile index 4654cdc8..a7d5231f 100644 --- a/Gemfile +++ b/Gemfile @@ -5,39 +5,48 @@ ruby "3.3.3" gem "rails", "~> 7.1.3", ">= 7.1.3.4" # Database -gem "sqlite3", "~> 1.4" gem "activerecord-enhancedsqlite3-adapter", "~> 0.8.0" +gem "sqlite3", "~> 1.4" # Jobs -gem "solid_queue" gem "mission_control-jobs" +gem "solid_queue" # Assets -gem "propshaft" gem "importmap-rails" +gem "propshaft" gem "tailwindcss-rails", "~> 2.6" # Hotwire -gem "turbo-rails" gem "stimulus-rails" +gem "turbo-rails" # Authorization gem "action_policy", "~> 0.7.0" # Other +gem "bootsnap", require: false gem "puma", ">= 5.0" gem "tzinfo-data", platforms: %i[windows jruby] -gem "bootsnap", require: false group :development, :test do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[mri windows] gem "dotenv" + gem "erb_lint", require: false gem "pry-byebug" gem "rspec-rails" + gem "rubocop-capybara", require: false + gem "rubocop-performance", require: false + gem "rubocop-rails", require: false + gem "rubocop-rspec", require: false + gem "rubocop-rspec_rails", require: false + gem "standard" end group :development do - gem "web-console" gem "rack-mini-profiler" + gem "web-console" end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 2227ff11..f5394b4e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,7 +82,15 @@ GEM tzinfo (~> 2.0) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) + ast (2.4.2) base64 (0.2.0) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.3) @@ -106,9 +114,19 @@ GEM capybara (~> 3.0) ferrum (~> 0.15.0) date (3.3.4) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) diff-lcs (1.5.1) dotenv (3.1.2) drb (2.2.1) + erb_lint (0.5.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop + smart_properties erubi (1.13.0) et-orbi (1.2.11) tzinfo @@ -135,6 +153,9 @@ GEM irb (1.13.2) rdoc (>= 4.0.0) reline (>= 0.4.2) + json (2.7.2) + language_server-protocol (3.17.0.3) + lint_roller (1.1.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -165,18 +186,12 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.6-aarch64-linux) - racc (~> 1.4) - nokogiri (1.16.6-arm-linux) - racc (~> 1.4) nokogiri (1.16.6-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.6-x86-linux) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-linux) - racc (~> 1.4) + parallel (1.25.1) + parser (3.3.3.0) + ast (~> 2.4.1) + racc propshaft (0.9.0) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -234,12 +249,15 @@ GEM rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) + rainbow (3.1.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) regexp_parser (2.9.2) reline (0.5.9) io-console (~> 0.5) + rexml (3.3.1) + strscan rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -265,35 +283,62 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) + rubocop (1.64.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.0.1) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-next-core (1.0.3) ruby-progressbar (1.13.0) + smart_properties (1.17.0) solid_queue (0.3.3) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) fugit (~> 1.11.0) railties (>= 7.1) - sqlite3 (1.7.3-aarch64-linux) - sqlite3 (1.7.3-arm-linux) sqlite3 (1.7.3-arm64-darwin) - sqlite3 (1.7.3-x86-linux) - sqlite3 (1.7.3-x86_64-darwin) - sqlite3 (1.7.3-x86_64-linux) + standard (1.39.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.64.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.4) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.4.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.21.0) stimulus-rails (1.3.3) railties (>= 6.0.0) stringio (3.1.1) - tailwindcss-rails (2.6.1) - railties (>= 7.0.0) - tailwindcss-rails (2.6.1-aarch64-linux) - railties (>= 7.0.0) - tailwindcss-rails (2.6.1-arm-linux) - railties (>= 7.0.0) + strscan (3.1.0) tailwindcss-rails (2.6.1-arm64-darwin) railties (>= 7.0.0) - tailwindcss-rails (2.6.1-x86_64-darwin) - railties (>= 7.0.0) - tailwindcss-rails (2.6.1-x86_64-linux) - railties (>= 7.0.0) thor (1.3.1) timeout (0.4.1) turbo-rails (2.0.5) @@ -302,6 +347,7 @@ GEM railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + unicode-display_width (2.5.0) web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -316,14 +362,8 @@ GEM zeitwerk (2.6.16) PLATFORMS - aarch64-linux - arm-linux arm64-darwin-21 - arm64-darwin-22 arm64-darwin-23 - x86-linux - x86_64-darwin - x86_64-linux DEPENDENCIES action_policy (~> 0.7.0) @@ -331,7 +371,9 @@ DEPENDENCIES bootsnap capybara cuprite + debug dotenv + erb_lint fuubar importmap-rails mission_control-jobs @@ -343,8 +385,14 @@ DEPENDENCIES rspec-instafail rspec-rails rspec-retry + rubocop-capybara + rubocop-performance + rubocop-rails + rubocop-rspec + rubocop-rspec_rails solid_queue sqlite3 (~> 1.4) + standard stimulus-rails tailwindcss-rails (~> 2.6) turbo-rails diff --git a/README.md b/README.md index 33e74235..6c325f86 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,38 @@ 1. Run `bin/setup` (needs to be run only once) 2. Run `bin/dev` +## Linting & Formatting + +#### Ruby + +We use [Standard Ruby](https://github.com/standardrb/standard) for linting and formatting. +- Run `bundle exec rubocop` to check all ruby files +- Run `bundle exec rubocop -a` to auto-correct offenses +- [How do I run RuboCop in my editor?](https://docs.rubocop.org/rubocop/1.25/integration_with_other_tools.html#editor-integration) + +#### ERB + +We use [ERB Lint](https://github.com/Shopify/erb-lint) to lint our ERB files. +- Run `bundle exec erblint --lint-all` to check all ERB files +- Run `bundle exec erblint --lint-all -a` to auto-correct offenses. WARNING: This command isn't safe and can break your code. + +#### JavaScript + +We use [StandardJS](https://standardjs.com/) to lint our JavaScript files. +- Install by running `npm install standard --global` +- Run `standard` to check all JavaScript files +- Run `standard --fix` to auto-correct offenses +- [How do I run StandardJS in my editor?](https://standardjs.com/#are-there-text-editor-plugins) +- [How do I make the output more readable?](https://github.com/standard/standard?tab=readme-ov-file#how-do-i-make-the-output-all-colorful-and-pretty) + +#### Spelling + +We use [Typos](https://github.com/crate-ci/typos) as a spell checker. +- Install by running `brew install typos-cli` +- Run `typos` to check all files +- Run `typos -w` to auto-correct offenses +- For false positives and other configuration, see the `_typos.yml` file + ## Testing Run tests by using `bundle exec rspec`. diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..6fd957c1 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,15 @@ +# https://github.com/crate-ci/typos/blob/master/docs/reference.md + +[default.extend-words] +# Don't correct the following words + +[files] +extend-exclude = [ + "app/assets/stylesheets/**", + "app/assets/fonts/**", + "vendor/**", + "/spec/fixtures/**", + "/lib/assets/**", + "*.css", + "*.pdf", +] diff --git a/app/javascript/application.js b/app/javascript/application.js index 0d7b4940..9c394a0c 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,3 +1,3 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import "@hotwired/turbo-rails" -import "controllers" +import '@hotwired/turbo-rails' +import 'controllers' diff --git a/app/javascript/controllers/application.js b/app/javascript/controllers/application.js index 1213e85c..c030eb8c 100644 --- a/app/javascript/controllers/application.js +++ b/app/javascript/controllers/application.js @@ -1,9 +1,9 @@ -import { Application } from "@hotwired/stimulus" +import { Application } from '@hotwired/stimulus' const application = Application.start() // Configure Stimulus development experience application.debug = false -window.Stimulus = application +window.Stimulus = application export { application } diff --git a/app/javascript/controllers/hello_controller.js b/app/javascript/controllers/hello_controller.js index 5975c078..f914115e 100644 --- a/app/javascript/controllers/hello_controller.js +++ b/app/javascript/controllers/hello_controller.js @@ -1,7 +1,7 @@ -import { Controller } from "@hotwired/stimulus" +import { Controller } from '@hotwired/stimulus' export default class extends Controller { - connect() { - this.element.textContent = "Hello World!" + connect () { + this.element.textContent = 'Hello World!' } } diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 54ad4cad..390177a3 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -1,10 +1,10 @@ // Import and register all your controllers from the importmap under controllers/* -import { application } from "controllers/application" +import { application } from 'controllers/application' // Eager load all controllers defined in the import map under controllers/**/*_controller -import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" -eagerLoadControllersFrom("controllers", application) +import { eagerLoadControllersFrom } from '@hotwired/stimulus-loading' +eagerLoadControllersFrom('controllers', application) // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading" diff --git a/app/models/conference.rb b/app/models/conference.rb index 5a2a7316..f4298ddf 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -1,4 +1,4 @@ class Conference < ApplicationRecord - has_many :events - has_many :locations + has_many :events, dependent: :destroy + has_many :locations, dependent: :destroy end diff --git a/app/models/event.rb b/app/models/event.rb index 9873e39d..97f3dc53 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -2,9 +2,9 @@ class Event < ApplicationRecord belongs_to :location belongs_to :conference - has_many :event_tags - has_many :saved_events - has_many :speakers + has_many :event_tags, dependent: :destroy + has_many :saved_events, dependent: :destroy + has_many :speakers, dependent: :destroy has_many :tags, through: :event_tags has_many :users, through: :saved_events end diff --git a/app/models/location.rb b/app/models/location.rb index cec365a6..17b18ead 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -1,5 +1,5 @@ class Location < ApplicationRecord belongs_to :conference - has_many :events + has_many :events, dependent: :destroy end diff --git a/app/models/profile.rb b/app/models/profile.rb index 502b6d7e..9f5487a6 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -1,7 +1,7 @@ class Profile < ApplicationRecord belongs_to :profileable, polymorphic: true - has_one :self_ref, class_name: 'Profile', foreign_key: :id - has_one :user, through: :self_ref, source: :profileable, source_type: 'User' - has_one :speaker, through: :self_ref, source: :profileable, source_type: 'Speaker' + has_one :self_ref, class_name: "Profile", foreign_key: :id, inverse_of: :self_ref, dependent: :destroy + has_one :user, through: :self_ref, source: :profileable, source_type: "User" + has_one :speaker, through: :self_ref, source: :profileable, source_type: "Speaker" end diff --git a/app/models/speaker.rb b/app/models/speaker.rb index 5dcb9389..3830d90a 100644 --- a/app/models/speaker.rb +++ b/app/models/speaker.rb @@ -1,5 +1,5 @@ class Speaker < ApplicationRecord belongs_to :event - has_one :profile, as: :profileable + has_one :profile, as: :profileable, dependent: :destroy end diff --git a/app/models/tag.rb b/app/models/tag.rb index a18315c7..74b025f2 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,4 +1,4 @@ class Tag < ApplicationRecord - has_many :event_tags + has_many :event_tags, dependent: :destroy has_many :events, through: :event_tags end diff --git a/app/models/user.rb b/app/models/user.rb index 5d5b2226..bfc040e8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,6 @@ class User < ApplicationRecord - has_one :profile, as: :profileable + has_one :profile, as: :profileable, dependent: :destroy - has_many :saved_events + has_many :saved_events, dependent: :destroy has_many :events, through: :saved_events end diff --git a/config/environments/development.rb b/config/environments/development.rb index 8f9021f2..25334d0b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -58,6 +58,7 @@ # Highlight code that enqueued background job in logs. config.active_job.verbose_enqueue_logs = true + config.active_job.queue_adapter = :solid_queue # Raises error for missing translations. diff --git a/config/environments/production.rb b/config/environments/production.rb index 087a3b43..92c5c493 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,7 +46,7 @@ config.force_ssl = true # Log to STDOUT by default - config.logger = ActiveSupport::Logger.new(STDOUT) + config.logger = ActiveSupport::Logger.new($stdout) .tap { |logger| logger.formatter = ::Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } diff --git a/config/tailwind.config.js b/config/tailwind.config.js index d6ad82c0..7cba2be2 100644 --- a/config/tailwind.config.js +++ b/config/tailwind.config.js @@ -10,13 +10,13 @@ module.exports = { theme: { extend: { fontFamily: { - sans: ['Inter var', ...defaultTheme.fontFamily.sans], - }, - }, + sans: ['Inter var', ...defaultTheme.fontFamily.sans] + } + } }, plugins: [ require('@tailwindcss/forms'), require('@tailwindcss/typography'), - require('@tailwindcss/container-queries'), + require('@tailwindcss/container-queries') ] } diff --git a/db/migrate/20240628210301_create_profiles.rb b/db/migrate/20240628210301_create_profiles.rb index 9812d8ea..1ae65f00 100644 --- a/db/migrate/20240628210301_create_profiles.rb +++ b/db/migrate/20240628210301_create_profiles.rb @@ -9,7 +9,7 @@ def change t.string :github_url t.string :linkedin_url t.string :twitter_url - t.boolean :public + t.boolean :public, default: false, null: false t.timestamps end diff --git a/db/migrate/20240628211820_create_users.rb b/db/migrate/20240628211820_create_users.rb index 70046719..b023a1cb 100644 --- a/db/migrate/20240628211820_create_users.rb +++ b/db/migrate/20240628211820_create_users.rb @@ -3,8 +3,8 @@ def change create_table :users do |t| t.string :email t.string :role - t.boolean :mail_notifications_enabled, default: true - t.boolean :in_app_notifications_enabled, default: true + t.boolean :mail_notifications_enabled, default: true, null: false + t.boolean :in_app_notifications_enabled, default: true, null: false t.timestamps end diff --git a/db/queue_migrate/20240626184926_create_solid_queue_tables.solid_queue.rb b/db/queue_migrate/20240626184926_create_solid_queue_tables.solid_queue.rb index 6d8c4f61..2591b73d 100644 --- a/db/queue_migrate/20240626184926_create_solid_queue_tables.solid_queue.rb +++ b/db/queue_migrate/20240626184926_create_solid_queue_tables.solid_queue.rb @@ -13,42 +13,42 @@ def change t.timestamps - t.index [ :queue_name, :finished_at ], name: "index_solid_queue_jobs_for_filtering" - t.index [ :scheduled_at, :finished_at ], name: "index_solid_queue_jobs_for_alerting" + t.index [:queue_name, :finished_at], name: "index_solid_queue_jobs_for_filtering" + t.index [:scheduled_at, :finished_at], name: "index_solid_queue_jobs_for_alerting" end create_table :solid_queue_scheduled_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.datetime :scheduled_at, null: false t.datetime :created_at, null: false - t.index [ :scheduled_at, :priority, :job_id ], name: "index_solid_queue_dispatch_all" + t.index [:scheduled_at, :priority, :job_id], name: "index_solid_queue_dispatch_all" end create_table :solid_queue_ready_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.datetime :created_at, null: false - t.index [ :priority, :job_id ], name: "index_solid_queue_poll_all" - t.index [ :queue_name, :priority, :job_id ], name: "index_solid_queue_poll_by_queue" + t.index [:priority, :job_id], name: "index_solid_queue_poll_all" + t.index [:queue_name, :priority, :job_id], name: "index_solid_queue_poll_by_queue" end create_table :solid_queue_claimed_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.bigint :process_id t.datetime :created_at, null: false - t.index [ :process_id, :job_id ] + t.index [:process_id, :job_id] end create_table :solid_queue_blocked_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.string :queue_name, null: false t.integer :priority, default: 0, null: false t.string :concurrency_key, null: false @@ -56,17 +56,17 @@ def change t.datetime :created_at, null: false - t.index [ :expires_at, :concurrency_key ], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index [:expires_at, :concurrency_key], name: "index_solid_queue_blocked_executions_for_maintenance" end create_table :solid_queue_failed_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.text :error t.datetime :created_at, null: false end create_table :solid_queue_pauses do |t| - t.string :queue_name, null: false, index: { unique: true } + t.string :queue_name, null: false, index: {unique: true} t.datetime :created_at, null: false end @@ -83,13 +83,13 @@ def change end create_table :solid_queue_semaphores do |t| - t.string :key, null: false, index: { unique: true } + t.string :key, null: false, index: {unique: true} t.integer :value, default: 1, null: false t.datetime :expires_at, null: false, index: true t.timestamps - t.index [ :key, :value ], name: "index_solid_queue_semaphores_on_key_and_value" + t.index [:key, :value], name: "index_solid_queue_semaphores_on_key_and_value" end add_foreign_key :solid_queue_blocked_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade diff --git a/db/queue_migrate/20240626184927_add_missing_index_to_blocked_executions.solid_queue.rb b/db/queue_migrate/20240626184927_add_missing_index_to_blocked_executions.solid_queue.rb index 2d96b10d..53e74dc8 100644 --- a/db/queue_migrate/20240626184927_add_missing_index_to_blocked_executions.solid_queue.rb +++ b/db/queue_migrate/20240626184927_add_missing_index_to_blocked_executions.solid_queue.rb @@ -1,6 +1,6 @@ # This migration comes from solid_queue (originally 20240110143450) class AddMissingIndexToBlockedExecutions < ActiveRecord::Migration[7.1] def change - add_index :solid_queue_blocked_executions, [ :concurrency_key, :priority, :job_id ], name: "index_solid_queue_blocked_executions_for_release" + add_index :solid_queue_blocked_executions, [:concurrency_key, :priority, :job_id], name: "index_solid_queue_blocked_executions_for_release" end end diff --git a/db/queue_migrate/20240626184928_create_recurring_executions.solid_queue.rb b/db/queue_migrate/20240626184928_create_recurring_executions.solid_queue.rb index 4c49821b..7f441b2f 100644 --- a/db/queue_migrate/20240626184928_create_recurring_executions.solid_queue.rb +++ b/db/queue_migrate/20240626184928_create_recurring_executions.solid_queue.rb @@ -2,12 +2,12 @@ class CreateRecurringExecutions < ActiveRecord::Migration[7.1] def change create_table :solid_queue_recurring_executions do |t| - t.references :job, index: { unique: true }, null: false + t.references :job, index: {unique: true}, null: false t.string :task_key, null: false t.datetime :run_at, null: false t.datetime :created_at, null: false - t.index [ :task_key, :run_at ], unique: true + t.index [:task_key, :run_at], unique: true end add_foreign_key :solid_queue_recurring_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade diff --git a/package.json b/package.json new file mode 100644 index 00000000..43348ddf --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "rails_world", + "version": "1.0.0", + "standard": { + "ignore": ["vendor/**"] + } +} diff --git a/spec/system/test_spec.rb b/spec/system/test_spec.rb index 2cc92c0b..2510aef5 100644 --- a/spec/system/test_spec.rb +++ b/spec/system/test_spec.rb @@ -1,8 +1,8 @@ require "rails_helper" RSpec.describe "System specs health check", type: :system do - it "works" do + it "website is up" do visit "/up" - expect(page).to have_http_status(200) + expect(page).to have_http_status(:ok) end end