Class: SiteMapPathHistory
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SiteMapPathHistory
- Defined in:
- app/models/site_map_path_history.rb
Overview
A prior path a SiteMap page was served at, retained when the page's URL
changes so an old URL can 301 to its current path instead of 404ing.
See doc/tasks/202606042115_SITEMAP_URL_HISTORY.md. Written by
SiteMap#record_path_history on a path change; read by the redirect resolver,
which looks up an incoming (locale, path) and redirects to the owning
SiteMap's current path.
Constant Summary
Constants included from Models::Schedulable
Models::Schedulable::SIMPLE_FORM_OPTIONS
Instance Attribute Summary collapse
-
#locale ⇒ String
Locale of the prior path.
-
#path ⇒ String
Prior path segment.
-
#recorded_at ⇒ Time
When the path change was recorded.
Belongs to collapse
Methods inherited from ApplicationRecord
ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation
Methods included from Models::Schedulable
Methods included from Models::AfterCommittable
Methods included from Models::EventPublishable
Instance Attribute Details
#locale ⇒ String
Returns Locale of the prior path.
20 |
# File 'app/models/site_map_path_history.rb', line 20 validates :locale, :path, :recorded_at, presence: true |
#path ⇒ String
Returns Prior path segment.
Validations:
- Uniqueness ({ scope: :locale })
20 |
# File 'app/models/site_map_path_history.rb', line 20 validates :locale, :path, :recorded_at, presence: true |
#recorded_at ⇒ Time
Returns When the path change was recorded.
20 |
# File 'app/models/site_map_path_history.rb', line 20 validates :locale, :path, :recorded_at, presence: true |