class Sequent::Migrations::Migration

Attributes

record_class[R]
version[RW]

Public Class Methods

inherited(child_class) click to toggle source
Calls superclass method
# File lib/sequent/migrations/functions.rb, line 14
def self.inherited(child_class)
  super
  class << child_class
    include ClassMethods
  end
end
new(record_class) click to toggle source
# File lib/sequent/migrations/functions.rb, line 24
def initialize(record_class)
  @record_class = record_class
  @version = nil
end

Public Instance Methods

==(other) click to toggle source
# File lib/sequent/migrations/functions.rb, line 37
def ==(other)
  return false unless other.class == self.class

  table_name == other.table_name && version == other.version
end
copy(with_version) click to toggle source
# File lib/sequent/migrations/functions.rb, line 33
def copy(with_version)
  self.class.create(record_class, with_version)
end
hash() click to toggle source
# File lib/sequent/migrations/functions.rb, line 43
def hash
  table_name.hash + (version&.hash || 0)
end
table_name() click to toggle source
# File lib/sequent/migrations/functions.rb, line 29
def table_name
  @record_class.table_name
end