Class: Integral::Version

Inherits:
ApplicationRecord show all
Includes:
PaperTrail::VersionConcern
Defined in:
app/models/integral/version.rb

Overview

Base Version class Version < PaperTrail::Version

Class Method Summary collapse

Methods inherited from ApplicationRecord

available_statuses

Class Method Details

.available_actionsArray

Returns available version actions.

Returns:

  • (Array)

    available version actions



10
11
12
13
14
15
16
17
18
# File 'app/models/integral/version.rb', line 10

def self.available_actions
  available = []

  %w[update create destroy publish].each do |item|
    available << [I18n.t("integral.actions.#{item}"), item]
  end

  available
end

.available_objectsArray

Returns available version objects.

Returns:

  • (Array)

    available version objects



21
22
23
24
25
26
27
28
29
# File 'app/models/integral/version.rb', line 21

def self.available_objects
  available = []

  ActsAsIntegral.tracked_classes.each do |item|
    available << [item.model_name.human, item]
  end

  available
end