@@ -48,7 +48,7 @@ class Project < ApplicationRecord
48
48
49
49
# All badge levels as IDs. Useful for enumerating "all levels" as:
50
50
# Project::LEVEL_IDS.each do |level| ... end
51
- LEVEL_ID_NUMBERS = ( 0 ..( COMPLETED_BADGE_LEVELS . length - 1 ) ) . freeze
51
+ LEVEL_ID_NUMBERS = ( 0 ..( COMPLETED_BADGE_LEVELS . length - 1 ) )
52
52
LEVEL_IDS = LEVEL_ID_NUMBERS . map ( &:to_s )
53
53
54
54
PROJECT_OTHER_FIELDS = %i[
@@ -173,7 +173,7 @@ class Project < ApplicationRecord
173
173
# We have to allow embedded spaces, e.g., "Jupyter Notebook".
174
174
VALID_LANGUAGE_LIST =
175
175
%r{\A (|-| ([A-Za-z0-9!\# $%'()*+.\/ \: ;=?@\[ \] ^~ -]+
176
- (,\ ?[A-Za-z0-9!\# $%'()*+.\/ \: ;=?@\[ \] ^~ -]+)*))\Z }x . freeze
176
+ (,\ ?[A-Za-z0-9!\# $%'()*+.\/ \: ;=?@\[ \] ^~ -]+)*))\Z }x
177
177
validates :implementation_languages ,
178
178
length : { maximum : MAX_SHORT_STRING_LENGTH } ,
179
179
format : {
@@ -536,8 +536,7 @@ def self.projects_to_remind
536
536
. where ( 'badge_percentage_0 < 100' )
537
537
. where ( 'lost_passing_at IS NULL OR lost_passing_at < ?' ,
538
538
LOST_PASSING_REMINDER . days . ago )
539
- . where ( 'projects.updated_at < ?' ,
540
- LAST_UPDATED_REMINDER . days . ago )
539
+ . where ( 'projects.updated_at < ?' , LAST_UPDATED_REMINDER . days . ago )
541
540
. where ( 'last_reminder_at IS NULL OR last_reminder_at < ?' ,
542
541
LAST_SENT_REMINDER . days . ago )
543
542
. joins ( :user ) . references ( :user ) # Need this to check email address
@@ -576,7 +575,7 @@ def self.recently_reminded
576
575
. select ( 'projects.*, users.encrypted_email as user_encrypted_email' )
577
576
. joins ( :user ) . references ( :user ) # Need this to check email address
578
577
. where ( 'last_reminder_at IS NOT NULL' )
579
- . where ( ' last_reminder_at >= ?' , 14 . days . ago )
578
+ . where ( last_reminder_at : 14 . days . ago .. )
580
579
. reorder ( 'last_reminder_at' )
581
580
end
582
581
0 commit comments