2019-03-20 11:01:53 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Setting values, kept history of modifications
|
2020-12-22 09:53:41 +01:00
|
|
|
class HistoryValue < Footprintable
|
2018-12-17 16:02:02 +01:00
|
|
|
belongs_to :setting
|
2019-06-03 16:51:43 +02:00
|
|
|
belongs_to :invoicing_profile
|
2019-03-20 11:01:53 +01:00
|
|
|
|
2023-03-23 17:39:06 +01:00
|
|
|
has_one :chained_element, as: :element, dependent: :restrict_with_exception
|
2023-03-24 17:21:44 +01:00
|
|
|
delegate :footprint, to: :chained_element
|
2022-11-17 11:47:47 +01:00
|
|
|
delegate :user, to: :invoicing_profile
|
|
|
|
|
2019-04-23 13:04:50 +02:00
|
|
|
after_create :chain_record
|
|
|
|
|
2021-04-16 16:03:10 +02:00
|
|
|
def sort_on_field
|
|
|
|
'created_at'
|
2020-07-21 19:25:21 +02:00
|
|
|
end
|
2018-12-17 16:02:02 +01:00
|
|
|
end
|