I’ve implemented it in a plugin that I wrote to support https://www.refrunner.com/. Something like this:
# frozen_string_literal: true
module Jobs
class RemoveExpiredFreeMonthMembers < ::Jobs::Scheduled
every 1.day
def execute(args)
return unless SiteSetting.discourse_citationwizard_enabled
group_id = SiteSetting.citation_wizard_free_month_group.to_i
return if group_id <= 0
GroupUser
.where(group_id: group_id)
.where("user_id > 0")
.where("created_at < ?", 1.month.ago)
.delete_all
end
end
end
If that’s not enough for you to solve it you can post in Marketplace and/or contact me.