Class: SiteMapPathHistory

Inherits:
ApplicationRecord show all
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 Schedulable

Schedulable::SIMPLE_FORM_OPTIONS

Instance Attribute Summary collapse

Belongs to collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Schedulable

config

Methods included from Models::AfterCommittable

#after_commit

Methods included from Models::EventPublishable

#publish_event

Instance Attribute Details

#localeObject (readonly)



13
# File 'app/models/site_map_path_history.rb', line 13

validates :locale, :path, :recorded_at, presence: true

#pathObject (readonly)



13
# File 'app/models/site_map_path_history.rb', line 13

validates :locale, :path, :recorded_at, presence: true

#recorded_atObject (readonly)



13
# File 'app/models/site_map_path_history.rb', line 13

validates :locale, :path, :recorded_at, presence: true

Instance Method Details

#site_mapSiteMap

Returns:

See Also:



11
# File 'app/models/site_map_path_history.rb', line 11

belongs_to :site_map