Module: ChronoModel::Chrono

Defined in:
lib/chrono_model/chrono.rb

Overview

A module to add to ActiveRecord::Base to check if they are backed by temporal tables.

Instance Method Summary collapse

Instance Method Details

#chrono?Boolean

Checks whether this Active Record model is backed by a temporal table

Returns:

  • (Boolean)

    false if the connection does not respond to is_chrono? the result of connection.is_chrono?(table_name) otherwise



11
12
13
14
15
# File 'lib/chrono_model/chrono.rb', line 11

def chrono?
  return false unless connection.respond_to? :is_chrono?

  connection.is_chrono?(table_name)
end