Skip to content

Instantly share code, notes, and snippets.

@avit
Created September 21, 2012 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avit/3759840 to your computer and use it in GitHub Desktop.
Save avit/3759840 to your computer and use it in GitHub Desktop.
class SomethingsController < ActionController::Base
def create
Time.zone = current_user.time_zone
@another_user = current_user.friends.find(params[:friend_id])
FriendMailer.message(@another_user).deliver
# Wouldn't Time.zone be reset by the mailer before rendering the page here?
end
end
class FriendMailer < ActionMailer::Base
def message(friend)
Time.zone = friend.time_zone
mail(to: friend.email, subject: "hello friend!")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment