[Cleanup] Remove merge_version?

This commit is contained in:
Earlopain 2022-04-08 11:49:58 +02:00
parent d70a66d76c
commit 029fabc279
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
4 changed files with 0 additions and 21 deletions

View File

@ -1368,11 +1368,6 @@ class Post < ApplicationRecord
saved_change_to_rating? || saved_change_to_source? || saved_change_to_parent_id? || saved_change_to_tag_string? || saved_change_to_locked_tags? || saved_change_to_description?
end
def merge_version?
prev = versions.last
prev && prev.updater_id == CurrentUser.user.id && prev.updated_at > 1.hour.ago
end
def create_new_version
# This function name is misleading, this directly creates the version.
# Previously there was a queue involved, now there isn't.

View File

@ -276,7 +276,6 @@ class ArtistTest < ActiveSupport::TestCase
context "when saving" do
setup do
@artist = FactoryBot.create(:artist, url_string: "http://foo.com")
@artist.stubs(:merge_version?).returns(false)
end
should "create a new version when an url is added" do

View File

@ -13,19 +13,6 @@ class NoteTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
context "#merge_version" do
setup do
@post = FactoryBot.create(:post)
@note = FactoryBot.create(:note, :post => @post)
end
should "not increment version" do
@note.update(:x => 100)
assert_equal(1, @note.versions.count)
assert_equal(1, @note.versions.first.version)
end
end
context "for a post that already has a note" do
setup do
@post = FactoryBot.create(:post)
@ -115,7 +102,6 @@ class NoteTest < ActiveSupport::TestCase
setup do
@post = FactoryBot.create(:post, :image_width => 1000, :image_height => 1000)
@note = FactoryBot.create(:note, :post => @post)
@note.stubs(:merge_version?).returns(false)
end
should "increment the updater's note_update_count" do

View File

@ -11,7 +11,6 @@ class UserRevertTest < ActiveSupport::TestCase
@post = create(:post, :tag_string => "aaa bbb ccc", :rating => "q", :source => "xyz")
end
@post.stubs(:merge_version?).returns(false)
CurrentUser.scoped(@user) do
@post.update(:tag_string => "bbb ccc xxx", :source => "", :rating => "e")
end