Skip to content

Commit

Permalink
[clean up] Add presence validation for object in SnapshotItem model
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrAnderson committed Aug 28, 2024
1 parent 55813d4 commit 3da53bc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/active_snapshot/models/snapshot_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 3da53bc

Please sign in to comment.