Files
Jorge Manrubia aad61b36bc Generate highlights in the user timezone, now that we persist it
Also, remove the dates and duration from the highlights records. Those are not relevant, only the events-derived
key is. If two users with different timezones have different activities, they should see different summaries.
2025-09-05 12:39:09 +02:00

17 lines
426 B
Ruby

module User::Configurable
extend ActiveSupport::Concern
included do
has_one :settings, class_name: "User::Settings", dependent: :destroy
has_many :push_subscriptions, class_name: "Push::Subscription", dependent: :delete_all
after_create :create_settings, unless: :system?
delegate :timezone, to: :settings, allow_nil: true
end
def in_time_zone(&block)
Time.use_zone(timezone, &block)
end
end