Module: TemporalTables

Defined in:
lib/temporal_tables.rb,
lib/temporal_tables/version.rb,
lib/temporal_tables/whodunnit.rb,
lib/temporal_tables/history_hook.rb,
lib/temporal_tables/temporal_class.rb,
lib/temporal_tables/join_extensions.rb,
lib/temporal_tables/temporal_adapter.rb,
lib/temporal_tables/relation_extensions.rb,
lib/temporal_tables/preloader_extensions.rb,
lib/temporal_tables/reflection_extensions.rb,
lib/temporal_tables/association_extensions.rb,
lib/temporal_tables/connection_adapters/mysql_adapter.rb,
lib/temporal_tables/connection_adapters/postgresql_adapter.rb

Defined Under Namespace

Modules: AbstractReflectionExtensions, AssociationExtensions, ConnectionAdapters, HistoryHook, JoinDependencyExtensions, PreloaderExtensions, RelationExtensions, TemporalAdapter, TemporalClass, Whodunnit Classes: Railtie

Constant Summary collapse

VERSION =
"0.6.10"
@@create_by_default =
false
@@skipped_temporal_tables =
[:schema_migrations, :sessions, :ar_internal_metadata]
@@add_updated_by_field =
false
@@updated_by_type =
:string
@@updated_by_proc =
nil

Class Method Summary collapse

Class Method Details

.add_updated_by_field(type = :string, &block) ⇒ Object



57
58
59
60
61
62
63
64
65
# File 'lib/temporal_tables.rb', line 57

def self.add_updated_by_field(type = :string, &block)
  if block_given?
    @@add_updated_by_field = true
    @@updated_by_type = type
    @@updated_by_proc = block
  end

  @@add_updated_by_field
end

.create_by_defaultObject



33
34
35
# File 'lib/temporal_tables.rb', line 33

def self.create_by_default
  @@create_by_default
end

.create_by_default=(default) ⇒ Object



36
37
38
# File 'lib/temporal_tables.rb', line 36

def self.create_by_default=(default)
  @@create_by_default = default
end

.skip_temporal_table_for(*tables) ⇒ Object



41
42
43
# File 'lib/temporal_tables.rb', line 41

def self.skip_temporal_table_for(*tables)
  @@skipped_temporal_tables += tables
end

.skipped_temporal_tablesObject



44
45
46
# File 'lib/temporal_tables.rb', line 44

def self.skipped_temporal_tables
  @@skipped_temporal_tables.dup
end

.updated_by_procObject



54
55
56
# File 'lib/temporal_tables.rb', line 54

def self.updated_by_proc
  @@updated_by_proc
end

.updated_by_typeObject



51
52
53
# File 'lib/temporal_tables.rb', line 51

def self.updated_by_type
  @@updated_by_type
end