Sha256: 9f88c5af87369b0e85a733e4ffd6b8bd359608f32dac986f846f31554e200037

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

# frozen_string_literal: true

module ChronoModel
  # A module to add to ActiveRecord::Base to check if they are backed by
  # temporal tables.
  module Chrono
    # Checks whether this Active Record model is backed by a temporal table
    #
    # @return [Boolean] false if the connection does not respond to is_chrono?
    #   the result of connection.is_chrono?(table_name) otherwise
    def chrono?
      return false unless connection.respond_to? :is_chrono?

      connection.is_chrono?(table_name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chrono_model-3.0.1 lib/chrono_model/chrono.rb
chrono_model-2.0.0 lib/chrono_model/chrono.rb