Fix post archive test failures.

Fix test failures due to Post#versions not being defined when post
archives wasn't enabled because the SQS url wasn't configured.
This commit is contained in:
evazion
2018-09-29 19:07:37 -05:00
parent dfb7cf6994
commit 929fd29c33

View File

@@ -5,7 +5,7 @@ class PostArchive < ApplicationRecord
belongs_to_updater counter_cache: "post_update_count"
def self.enabled?
Danbooru.config.aws_sqs_archives_url.present?
Rails.env.test? || Danbooru.config.aws_sqs_archives_url.present?
end
establish_connection (ENV["ARCHIVE_DATABASE_URL"] || "archive_#{Rails.env}".to_sym) if enabled?