From fe34579dd9f972fe62cb8be48c92838d1a7f7ff4 Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 14 Nov 2023 23:49:04 +0100 Subject: [PATCH] Revert dummy changes in Rails files --- app/models/notion.rb | 3 +-- spec/rails_helper.rb | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/notion.rb b/app/models/notion.rb index 93b7f6fb3..61efb9ea5 100644 --- a/app/models/notion.rb +++ b/app/models/notion.rb @@ -1,4 +1,3 @@ -# is it working? class Notion < ApplicationRecord belongs_to :tag, optional: true, touch: true belongs_to :aliased_tag, class_name: 'Tag', optional: true, touch: true @@ -7,8 +6,8 @@ class Notion < ApplicationRecord validates :title, presence: true validate :presence_of_tag, if: :persisted? - after_save :touch_tag_relations before_destroy :touch_tag_relations + after_save :touch_tag_relations def presence_of_tag return if tag || aliased_tag diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ae15b1905..21326d460 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,9 +1,8 @@ # frozen_string_literal: true # This file is copied to spec/ when you run 'rails generate rspec:install' -# Test require 'spec_helper' -require File.expand_path('../../config/environment', __FILE__) +require File.expand_path('../config/environment', __dir__) # Prevent database truncation if the environment is production abort('The Rails env is running in production mode!') if Rails.env.production? require 'rspec/rails' @@ -29,7 +28,7 @@ # If you are not using ActiveRecord, you can remove this line. ActiveRecord::Migration.maintain_test_schema! -Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } +Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } RSpec.configure do |config| # Include Factory Girl syntax to simplify calls to factories