Skip to content

Instantly share code, notes, and snippets.

@bdougie

bdougie/feed.rb Secret

Created August 13, 2015 23:19
Show Gist options
  • Select an option

  • Save bdougie/e1691a2da5938c57be8f to your computer and use it in GitHub Desktop.

Select an option

Save bdougie/e1691a2da5938c57be8f to your computer and use it in GitHub Desktop.
class Feedback
def self.dispatch_surveys!
upcoming_enrollments.each do |enrollment|
Rails.logger.info "dispatching feedback request to #{enrollment.user.name}"
enrollment.chain.feedbacks.create!
end
end
def self.upcoming_enrollments
all_active = Enrollment.currently_enrolled.includes
date = upcoming_thursday
all_active.select { |enrollment| CheckingFeedbackEligibility.new(enrollment, date).eligible? }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment