Class: Brillo::Adapter::Base
- Inherits:
-
Object
- Object
- Brillo::Adapter::Base
- Defined in:
- lib/brillo/adapter/base.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #dump_structure_and_migrations(config) ⇒ Object
- #footer ⇒ Object
- #header ⇒ Object
-
#initialize(db_config) ⇒ Base
constructor
A new instance of Base.
- #load_command ⇒ Object
Constructor Details
#initialize(db_config) ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/brillo/adapter/base.rb', line 5 def initialize(db_config) @config = db_config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/brillo/adapter/base.rb', line 4 def config @config end |
Instance Method Details
#dump_structure_and_migrations(config) ⇒ Object
16 17 18 19 20 |
# File 'lib/brillo/adapter/base.rb', line 16 def dump_structure_and_migrations(config) # Overrides the path the structure is dumped to in Rails >= 3.2 ENV['SCHEMA'] = ENV['DB_STRUCTURE'] = config.dump_path.to_s Rake::Task["db:structure:dump"].invoke end |
#footer ⇒ Object
12 13 14 |
# File 'lib/brillo/adapter/base.rb', line 12 def "" end |
#header ⇒ Object
8 9 10 |
# File 'lib/brillo/adapter/base.rb', line 8 def header ActiveRecord::Base.connection.dump_schema_information end |
#load_command ⇒ Object
22 23 24 |
# File 'lib/brillo/adapter/base.rb', line 22 def load_command raise NotImplementedError end |