mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
Load activesupport early so we can squish big strings
PT usually loads AS, unless something goes really wrong; we're just loading it earlier. This is not a new dependency.
This commit is contained in:
parent
0bc9eb1f5f
commit
3a4df1164d
1 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
|||
require "active_support"
|
||||
require "request_store"
|
||||
require "paper_trail/cleaner"
|
||||
require "paper_trail/config"
|
||||
|
@ -13,6 +14,12 @@ require "paper_trail/serializers/yaml"
|
|||
# An ActiveRecord extension that tracks changes to your models, for auditing or
|
||||
# versioning.
|
||||
module PaperTrail
|
||||
E_TIMESTAMP_FIELD_CONFIG = <<-EOS.squish.freeze
|
||||
PaperTrail.timestamp_field= has been removed, without replacement. It is no
|
||||
longer configurable. The timestamp field in the versions table must now be
|
||||
named created_at.
|
||||
EOS
|
||||
|
||||
extend PaperTrail::Cleaner
|
||||
|
||||
class << self
|
||||
|
@ -72,11 +79,7 @@ module PaperTrail
|
|||
# Set the field which records when a version was created.
|
||||
# @api public
|
||||
def timestamp_field=(_field_name)
|
||||
raise(
|
||||
"PaperTrail.timestamp_field= has been removed, without replacement. " \
|
||||
"It is no longer configurable. The timestamp field in the versions table " \
|
||||
"must now be named created_at."
|
||||
)
|
||||
raise(E_TIMESTAMP_FIELD_CONFIG)
|
||||
end
|
||||
|
||||
# Sets who is responsible for any changes that occur. You would normally use
|
||||
|
|
Loading…
Reference in a new issue