Module: StrongSchema

Extended by:
IgnoreChecks
Defined in:
lib/strong_schema.rb,
lib/strong_schema/railtie.rb,
lib/strong_schema/version.rb,
lib/strong_schema/ignore_checks.rb,
lib/strong_schema/table_extension.rb,
lib/strong_schema/schema_extension.rb

Defined Under Namespace

Modules: IgnoreChecks, SchemaExtension, TableExtension Classes: Railtie

Constant Summary collapse

VERSION =

: String

"0.1.0"

Class Method Summary collapse

Methods included from IgnoreChecks

add_ignore, ignore_checks, reset_ignores!, should_ignore?

Class Method Details

.install_boot_hookObject

: () -> void



29
30
31
32
33
34
35
36
37
# File 'lib/strong_schema.rb', line 29

def install_boot_hook
  if defined?(Rails::Railtie)
    require_relative "strong_schema/railtie"
  elsif defined?(ActiveRecord::Base)
    setup
  elsif defined?(ActiveSupport)
    ActiveSupport.on_load(:active_record) { StrongSchema.setup }
  end
end

.setupObject

: () -> void



19
20
21
22
23
24
25
26
# File 'lib/strong_schema.rb', line 19

def setup
  return if @setup_done

  ActiveRecord::Schema.prepend(SchemaExtension)
  ActiveRecord::ConnectionAdapters::Table.prepend(TableExtension)

  @setup_done = true
end