Sha256: 2a6561087f28170b731c4879aa890b4ce81c7f29ba43d7f695451f0301632cf9

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

PaperTrail::Version.module_eval do
  unless ActiveRecord::Base.connection.table_exists? 'versions'
    self.abstract_class = true
  end
end

class Revelry::Content::ContentVersion < PaperTrail::Version
  self.table_name = :revelry_content_content_versions
  self.sequence_name = :revelry_content_version_id_seq
  before_save :cast_whodunnit

  def as_json(opts = {})
    Jbuilder.new do |json|
      json.(self, :id, :item_type, :item_id, :event, :whodunnit, :rollback_version_id, :created_at, :reify)
    end.attributes!
  end

  def cast_whodunnit
    self.whodunnit = whodunnit.to_s
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
revelry_content-1.0.0 app/models/revelry/content/content_version.rb