Class: SerialChronology

Inherits:
ApplicationRecord show all
Includes:
Housekeeping::Timestamps, Housekeeping::Users, Shared::IsData, Shared::SharedAcrossProjects
Defined in:
app/models/serial_chronology.rb

Overview

Stores the chronological relationship between two serials.

Direct Known Subclasses

SerialMerge, SerialSequence

Defined Under Namespace

Classes: SerialMerge, SerialSequence

Instance Attribute Summary collapse

Attributes included from Housekeeping::Users

#by

Method Summary

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Housekeeping::Users

#set_created_by_id, #set_updated_by_id

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Attribute Details

#preceding_serial_idInteger

Returns the reference/historical serial.

Returns:

  • (Integer)

    the reference/historical serial



15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/serial_chronology.rb', line 15

class SerialChronology < ApplicationRecord
  include Housekeeping::Users
  include Housekeeping::Timestamps
  include Shared::IsData
  include Shared::SharedAcrossProjects

  belongs_to :preceding_serial, class_name: 'Serial', foreign_key: :preceding_serial_id, inverse_of: :preceding_serial_chronologies
  belongs_to :succeeding_serial, class_name: 'Serial', foreign_key: :succeeding_serial_id, inverse_of: :succeeding_serial_chronologies

  validates_presence_of :preceding_serial_id, :succeeding_serial_id, :type
end

#succeeding_serial_idInteger

Returns the “new” serial.

Returns:

  • (Integer)

    the “new” serial



15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/serial_chronology.rb', line 15

class SerialChronology < ApplicationRecord
  include Housekeeping::Users
  include Housekeeping::Timestamps
  include Shared::IsData
  include Shared::SharedAcrossProjects

  belongs_to :preceding_serial, class_name: 'Serial', foreign_key: :preceding_serial_id, inverse_of: :preceding_serial_chronologies
  belongs_to :succeeding_serial, class_name: 'Serial', foreign_key: :succeeding_serial_id, inverse_of: :succeeding_serial_chronologies

  validates_presence_of :preceding_serial_id, :succeeding_serial_id, :type
end

#typeString

Returns the type of transition b/w the old and new.

Returns:

  • (String)

    the type of transition b/w the old and new



15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/serial_chronology.rb', line 15

class SerialChronology < ApplicationRecord
  include Housekeeping::Users
  include Housekeeping::Timestamps
  include Shared::IsData
  include Shared::SharedAcrossProjects

  belongs_to :preceding_serial, class_name: 'Serial', foreign_key: :preceding_serial_id, inverse_of: :preceding_serial_chronologies
  belongs_to :succeeding_serial, class_name: 'Serial', foreign_key: :succeeding_serial_id, inverse_of: :succeeding_serial_chronologies

  validates_presence_of :preceding_serial_id, :succeeding_serial_id, :type
end