asciinema.org/app/services/asciicast_updater.rb

19 lines
326 B
Ruby
Raw Normal View History

class AsciicastUpdater
def update(asciicast, attributes)
asciicast.attributes = attributes
need_snapshot_update = asciicast.snapshot_at_changed?
if asciicast.save
if need_snapshot_update
AsciicastSnapshotUpdater.new.update(asciicast)
end
true
else
false
end
end
end