Created
September 21, 2012 05:14
-
-
Save avit/3759840 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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