Class: Tenon::ItemVersion

Inherits:
ApplicationRecord show all
Defined in:
app/models/tenon/item_version.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.orphans(item_type) ⇒ Object



10
11
12
13
# File 'app/models/tenon/item_version.rb', line 10

def self.orphans(item_type)
  where('item_type = ?', item_type)
  .where('item_id IS NULL OR item_id = ?', 0)
end

Instance Method Details

#attrs=(hash) ⇒ Object



15
16
17
# File 'app/models/tenon/item_version.rb', line 15

def attrs=(hash)
  super(Tenon::HasHistory::AttrSerializer.serialize(hash, self))
end