Merry Christmas May this holiday season sparkle and shine. May all your wishes and dreams come true and may you feel this happiness all year round. sincerely, Binar::Apps Christmas.create

require 'snow'

class Christmas < ActiveRecord::Base

  before_create :save_me_from_tears

  def save_me_from_tears
    company = Company.find_by(name: 'Binar::Apps')
    someone = Someone.find(rand(Someone.count))
    heart = company.heart
    if this_year?
      heart.give_to(someone) if someone.special?
    end
  end

  private

  def this_year?
    DateTime.now.year == 2014
  end

end