Class: MemoryTestFix::SchemaLoader
- Inherits:
-
Object
- Object
- MemoryTestFix::SchemaLoader
- Defined in:
- lib/memory_test_fix/schema_loader.rb
Overview
Set up database schema into in-memory database.
Class Method Summary collapse
-
.init_schema ⇒ Object
Initialize the schema for an in-memory database, if it is configured.
Instance Method Summary collapse
-
#init_schema ⇒ Object
private
Initialize the schema for the in-memoray database according to the configuration passed to the constructor.
-
#initialize(options = {}) ⇒ SchemaLoader
constructor
private
A new instance of SchemaLoader.
Constructor Details
#initialize(options = {}) ⇒ SchemaLoader
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SchemaLoader.
19 20 21 22 23 |
# File 'lib/memory_test_fix/schema_loader.rb', line 19 def initialize( = {}) @configuration = [:configuration] || ActiveRecord::Base.connection_config @migrator = [:migrator] || ActiveRecord::Migrator @loader = [:loader] || SchemaFileLoader end |
Class Method Details
.init_schema ⇒ Object
Initialize the schema for an in-memory database, if it is configured. See the README for details on how to configure Rails to use an in-memory database.
10 11 12 |
# File 'lib/memory_test_fix/schema_loader.rb', line 10 def self.init_schema new.init_schema end |
Instance Method Details
#init_schema ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the schema for the in-memoray database according to the configuration passed to the constructor.
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/memory_test_fix/schema_loader.rb', line 28 def init_schema return unless in_memory_database? inform_using_in_memory unless silent? if silent? || quiet? load_schema_silently else load_schema end end |