Fix "'archive_development' database is not configured." exception.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
class PoolArchive < ActiveRecord::Base
|
class PoolArchive < ActiveRecord::Base
|
||||||
establish_connection "archive_#{Rails.env}".to_sym
|
def self.enabled?
|
||||||
|
Danbooru.config.aws_sqs_archives_url.present?
|
||||||
|
end
|
||||||
|
|
||||||
|
establish_connection "archive_#{Rails.env}".to_sym if enabled?
|
||||||
self.table_name = "pool_versions"
|
self.table_name = "pool_versions"
|
||||||
|
|
||||||
module SearchMethods
|
module SearchMethods
|
||||||
@@ -29,10 +33,6 @@ class PoolArchive < ActiveRecord::Base
|
|||||||
|
|
||||||
extend SearchMethods
|
extend SearchMethods
|
||||||
|
|
||||||
def self.enabled?
|
|
||||||
Danbooru.config.aws_sqs_archives_url.present?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.sqs_service
|
def self.sqs_service
|
||||||
SqsService.new(Danbooru.config.aws_sqs_archives_url)
|
SqsService.new(Danbooru.config.aws_sqs_archives_url)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user