4

I want to manage multi time zone, in my Grape API, is there a way to add around filter to set the current user's time zone? like this in Rails

around_filter :set_time_zone

    def set_time_zone
      old_time_zone = Time.zone
      Time.zone = current_user.time_zone if logged_in?
      yield
    ensure
      Time.zone = old_time_zone
    end
user1883793
  • 4,011
  • 11
  • 36
  • 65

0 Answers0