From 3da53bc0aad735727e8b4be6c56c485e2bb51ed5 Mon Sep 17 00:00:00 2001 From: Artem Skrynnyk Date: Wed, 28 Aug 2024 17:40:02 +0300 Subject: [PATCH] [clean up] Add presence validation for `object` in SnapshotItem model --- lib/active_snapshot/models/snapshot_item.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/active_snapshot/models/snapshot_item.rb b/lib/active_snapshot/models/snapshot_item.rb index 7ffa1c7..435d1b2 100644 --- a/lib/active_snapshot/models/snapshot_item.rb +++ b/lib/active_snapshot/models/snapshot_item.rb @@ -14,8 +14,7 @@ class SnapshotItem < ActiveRecord::Base validates :item_type, presence: true validates :object, presence: true - def object(raw: false) - return super() if raw + def object return @object if @object if ActiveSnapshot.config.storage_method_json?