Generate random date range near now:

    require 'rubygems'
    require 'active_support/all'

    def time_rand from = 0.0, to = Time.now
      Time.at(from + rand * (to.to_f - from.to_f))
    end    

    9.times do
      start_date = time_rand(Time.now, Time.now + 2.months )
      end_date = time_rand(start_date, start_date + 9.weeks )

      puts "Random date #{start_date} to #{end_date}"
    end

#dates

Send an email:

  # Tell the UserMailer to send a welcome Email after save
  TenantMailer.test_email(current_tenant).deliver

Future: http://blog.plataformatec.com.br/2011/06/multipart-templates-with-markerb/ Create one version of the email in Markdown syntax and generate the multi-part plain text and html. #howto

Projects

Tags

Capsule Servers

Lost connection to server.