これら2つのコードスニペットの違いは何ですか?そして、いつ一方を使用する必要がありますか?
Time.zone
class ApplicationController < ActionController::Base
before_filter :set_time_zone
def set_time_zone
Time.zone = current_user.time_zone
end
end
Time.use_zone
class ApplicationController < ActionController::Base
around_filter :set_time_zone
def set_time_zone(&block)
Time.use_zone(current_user.time_zone, &block)
end
end