#!/usr/bin/env ruby
# frozen_string_literal: true

require 'rubygems'
require 'bundler/setup'
# require 'mailman'
require 'mail'
require 'builder'
ENV['RAILS_ENV'] ||= 'production'
require File.dirname(__FILE__) + '/../config/environment'

grants = Dotation.where(active: true).where.not(end_date: nil)
grants.each do |grant|
  if grant.end_date < Time.now
    grant.active = false
    grant.save
  end
end
