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/scope_extensions.rb,
lib/temporal_tables/temporal_adapter.rb,
lib/temporal_tables/relation_extensions.rb,
lib/temporal_tables/connection_adapters/mysql_adapter.rb,
lib/temporal_tables/connection_adapters/postgresql_adapter.rb
Defined Under Namespace
Modules: AssociationExtensions, ConnectionAdapters, HistoryHook, NamedExtensionsWithHistory, PreloaderExtensions, RelationExtensions, TemporalAdapter, TemporalClass, Whodunnit
Classes: Railtie
Constant Summary
collapse
- VERSION =
"0.6.1"
- @@create_by_default =
false
- @@skipped_temporal_tables =
[:schema_migrations, :sessions]
- @@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
54
55
56
57
58
59
60
61
62
|
# File 'lib/temporal_tables.rb', line 54
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_default ⇒ Object
30
31
32
|
# File 'lib/temporal_tables.rb', line 30
def self.create_by_default
@@create_by_default
end
|
.create_by_default=(default) ⇒ Object
33
34
35
|
# File 'lib/temporal_tables.rb', line 33
def self.create_by_default=(default)
@@create_by_default = default
end
|
.skip_temporal_table_for(*tables) ⇒ Object
38
39
40
|
# File 'lib/temporal_tables.rb', line 38
def self.skip_temporal_table_for(*tables)
@@skipped_temporal_tables += tables
end
|
.skipped_temporal_tables ⇒ Object
41
42
43
|
# File 'lib/temporal_tables.rb', line 41
def self.skipped_temporal_tables
@@skipped_temporal_tables.dup
end
|
.updated_by_proc ⇒ Object
51
52
53
|
# File 'lib/temporal_tables.rb', line 51
def self.updated_by_proc
@@updated_by_proc
end
|
.updated_by_type ⇒ Object
48
49
50
|
# File 'lib/temporal_tables.rb', line 48
def self.updated_by_type
@@updated_by_type
end
|