From f285eedd583ad69021023e22876af2e92963b151 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 14 Sep 2024 21:09:29 +0200 Subject: [PATCH 1/2] Fix url to visits page in notification --- app/services/visits/suggest.rb | 4 +++- app/views/notifications/_notification.html.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/visits/suggest.rb b/app/services/visits/suggest.rb index f4b419b7..b18fbbd3 100644 --- a/app/services/visits/suggest.rb +++ b/app/services/visits/suggest.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Visits::Suggest + include Rails.application.routes.url_helpers + attr_reader :points, :user, :start_at, :end_at def initialize(user, start_at:, end_at:) @@ -72,7 +74,7 @@ class Visits::Suggest def create_visits_notification(user) content = <<~CONTENT - New visits have been suggested based on your location data from #{Time.zone.at(start_at)} to #{Time.zone.at(end_at)}. You can review them in the <%= link_to 'Visits', visits_path %> section. + New visits have been suggested based on your location data from #{Time.zone.at(start_at)} to #{Time.zone.at(end_at)}. You can review them on the Visits page. CONTENT user.notifications.create!( diff --git a/app/views/notifications/_notification.html.erb b/app/views/notifications/_notification.html.erb index 99c4df5e..62a32b81 100644 --- a/app/views/notifications/_notification.html.erb +++ b/app/views/notifications/_notification.html.erb @@ -7,7 +7,7 @@ <% if params[:action] == 'show' %>
- <%= notification.content %> + <%= notification.content.html_safe %> <% if notification.error? %>
From bbcd55940c1ce87052d3a738eb462b7f5e79b64c Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Sat, 14 Sep 2024 21:11:17 +0200 Subject: [PATCH 2/2] Update changelog --- .app_version | 2 +- CHANGELOG.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.app_version b/.app_version index ebf55b3d..5daaa7ba 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.13.6 +0.13.7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 621af4c4..21b31a74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.13.7] — 2024-09-14 + +## Fixed + +- Link to Visits page in notification informing about new visit suggestion + + ## [0.13.6] — 2024-09-13 ### Fixed