0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 11:36:31 +08:00
discourse/lib/discourse_gifs.rb
David Battersby 9d6e597bab
DEV: check for author repo in gifs component installed (#41050)
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.
2026-06-19 16:39:20 +04:00

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