diff --git a/.app_version b/.app_version index 71790396..abd41058 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.2.3 +0.2.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e59af5a2..9be23fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ 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.2.4] — 2024-05-19 + +### Added + +- In right sidebar you can now see the total amount of geopoints aside of kilometers traveled + +### Fixed + +- Improved overall performance if the application by ignoring `raw_data` column during requests to `imports` and `points` tables. + +--- + + ## [0.2.3] — 2024-05-18 ### Added diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 304ae1f8..dd7f11c1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -72,4 +72,19 @@ module ApplicationHelper def app_theme current_user&.theme == 'light' ? 'light' : 'dark' end + + def sidebar_distance(distance) + return unless distance + + "#{distance} km" + end + + def sidebar_points(points) + return unless points + + points_number = points.size + points_pluralized = pluralize(points_number, 'point') + + "(#{points_pluralized})" + end end diff --git a/app/models/import.rb b/app/models/import.rb index f7451166..7101d018 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class Import < ApplicationRecord + self.ignored_columns = %w[raw_data] + belongs_to :user has_many :points, dependent: :destroy diff --git a/app/models/point.rb b/app/models/point.rb index a7a080a7..356a4664 100644 --- a/app/models/point.rb +++ b/app/models/point.rb @@ -1,4 +1,6 @@ class Point < ApplicationRecord + self.ignored_columns = %w[raw_data] + belongs_to :import, optional: true validates :latitude, :longitude, :timestamp, presence: true diff --git a/app/views/shared/_right_sidebar.html.erb b/app/views/shared/_right_sidebar.html.erb index 0dce2a02..e011699f 100644 --- a/app/views/shared/_right_sidebar.html.erb +++ b/app/views/shared/_right_sidebar.html.erb @@ -1,4 +1,4 @@ -<%= "#{@distance} km" if @distance %> +<%= sidebar_distance(@distance) %> <%= sidebar_points(@points) %>