From 11017b29e1fe318875c6d0d13905a59edf04f18a Mon Sep 17 00:00:00 2001 From: Mark Thomson Date: Thu, 2 Jul 2020 22:32:31 +1200 Subject: [PATCH] Remove root_id validation. --- lib/fragmentary/fragment.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/fragmentary/fragment.rb b/lib/fragmentary/fragment.rb index 3c10843..ea24935 100644 --- a/lib/fragmentary/fragment.rb +++ b/lib/fragmentary/fragment.rb @@ -28,9 +28,10 @@ def self.included(base) attr_accessor :indexed_children - validates :root_id, :presence => true - - self.cache_timestamp_format = :usec # Probably not needed for Rails 5, which uses :usec by default. + # Set cache timestamp format to :usec instead of :nsec because the latter is greater precision than Postgres supports, + # resulting in mismatches between timestamps on a newly created fragment and one retrieved from the database. + # Probably not needed for Rails 5, which uses :usec by default. + self.cache_timestamp_format = :usec end