Skip to content

Commit 1cd2409

Browse files
committed
Relax matching criteria
1 parent fa297c1 commit 1cd2409

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,7 @@
3030
# Ignore master key for decrypting credentials and more.
3131
/config/master.key
3232

33-
/data/
33+
/data/
34+
35+
*.dump
36+
.env

app/models/project.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Project < ApplicationRecord
2020
scope :matching_criteria, -> { where(matching_criteria: true) }
2121
scope :with_readme, -> { where.not(readme: nil) }
2222
scope :with_works, -> { where('length(works::text) > 2') }
23+
scope :with_repository, -> { where.not(repository: nil) }
2324

2425
def self.import_from_csv
2526

@@ -123,7 +124,11 @@ def self.stop_words
123124
end
124125

125126
def self.update_matching_criteria
126-
unreviewed.find_each{|p| p.matching_criteria = p.matching_criteria?;p.save if p.changed?}
127+
unreviewed.find_each(&:update_matching_criteria)
128+
end
129+
130+
def update_matching_criteria
131+
update(matching_criteria: matching_criteria?)
127132
end
128133

129134
def self.potential_good_topics
@@ -572,7 +577,7 @@ def avatar_url
572577
end
573578

574579
def matching_criteria?
575-
no_bad_topics? && good_topics? && external_users? && open_source_license? && active?
580+
good_topics? && external_users? && open_source_license? && active?
576581
end
577582

578583
def matching_topics
@@ -584,7 +589,7 @@ def no_bad_topics?
584589
end
585590

586591
def good_topics?
587-
matching_topics.length > 2
592+
matching_topics.length > 0
588593
end
589594

590595
def packages_count

0 commit comments

Comments
 (0)