Ignore disabled out-of-date remote themes (#10870)

Ignore disabled out-of-date remote themes (#10870)

No need to alert in admin dashboard about out of date remote themes that are disabled.

diff --git a/app/models/remote_theme.rb b/app/models/remote_theme.rb
index 292ba79..2ec39d6 100644
--- a/app/models/remote_theme.rb
+++ b/app/models/remote_theme.rb
@@ -104,6 +104,7 @@ class RemoteTheme < ActiveRecord::Base
 
   def self.out_of_date_themes
     self.joined_remotes.where("commits_behind > 0 OR remote_version <> local_version")
+      .where(themes: { enabled: true })
       .pluck("themes.name", "themes.id")
   end
 
diff --git a/spec/models/remote_theme_spec.rb b/spec/models/remote_theme_spec.rb
index 8b0e44e..70ebaae 100644
--- a/spec/models/remote_theme_spec.rb
+++ b/spec/models/remote_theme_spec.rb
@@ -245,6 +245,13 @@ describe RemoteTheme do
       remote.update!(local_version: "new version", commits_behind: 0)
       expect(described_class.out_of_date_themes).to eq([])
     end
+
+    it "ignores disabled out of date themes" do
+      remote.update!(local_version: "old version", remote_version: "new version", commits_behind: 2)
+      theme.update!(enabled: false)
+      expect(described_class.out_of_date_themes).to eq([])
+    end
+
   end
 
   context ".unreachable_themes" do

GitHub sha: 5130b4d6

This commit appears in #10870 which was approved by eviltrout. It was merged by pmusaraj.