Enable send reminders code, because saving profile_completed_at now

This commit is contained in:
Seth Call 2025-06-14 17:37:34 -05:00
parent 51ed748013
commit 5f3a327d35
3 changed files with 16 additions and 5 deletions

View File

@ -1,11 +1,19 @@
class AddSignupSurveySentAtToUsers < ActiveRecord::Migration
def self.up
execute "ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP"
User.find_each(batch_size:100) do |user|
User.where(id:user.id).update_all(signup_survey_sent_at: Time.now)
end
end
def self.down
execute "ALTER TABLE users DROP COLUMN signup_survey_sent_at"
end
end
=begin
ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP
ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP;
CREATE INDEX index_users_on_signup_survey_sent_at ON users USING btree (signup_survey_sent_at);
User.find_each(batch_size:100) do |user|
User.where(id:user.id).update_all(signup_survey_sent_at: Time.now)
end
=end

View File

@ -420,6 +420,12 @@ module JamRuby
User.where(id: self.id).update_all(updates)
end
# check if the profile looks complete
if musician_instruments.length > 0 || genre_players.length > 0
User.where(id: self.id).update_all(profile_completed_at: Time.now)
end
end
def self.hourly_check

View File

@ -13,10 +13,7 @@ module JamRuby
#TeacherPayment.hourly_check
User.hourly_check
AffiliatePartner.tally_up(Date.today)
# bring me back in once tested profile_completed_at is set somewhere
#EmailProfileReminder.send_reminders
EmailProfileReminder.send_reminders
EmailSignupSurvey.send_survey
GearSetupReminder.send_reminders
ConnectionManager.new.cleanup_dangling