mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 11:36:31 +08:00
The original theme component was created on the author's repository, which means when checking if the component is installed we should check for variations of both remote urls.
23 lines
515 B
Ruby
Vendored
23 lines
515 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseGifs
|
|
COMPONENT_NAME = "discourse-gifs"
|
|
|
|
REPO_URLS = %w[
|
|
https://github.com/discourse/discourse-gifs
|
|
https://github.com/xfalcox/discourse-gifs
|
|
].freeze
|
|
|
|
REMOTE_URLS = REPO_URLS.flat_map { |url| [url, "#{url}.git"] }.freeze
|
|
|
|
def self.component_installed?
|
|
component_scope.exists?
|
|
end
|
|
|
|
def self.component_scope
|
|
Theme
|
|
.joins(:remote_theme)
|
|
.where(component: true)
|
|
.where(remote_themes: { remote_url: REMOTE_URLS })
|
|
end
|
|
end
|