Class: StaticDb::Load
- Inherits:
-
Object
- Object
- StaticDb::Load
- Defined in:
- lib/static_db/load.rb
Instance Attribute Summary collapse
-
#fixture_path ⇒ Object
readonly
Returns the value of attribute fixture_path.
Instance Method Summary collapse
-
#initialize(fixture_path:) ⇒ Load
constructor
A new instance of Load.
- #perform ⇒ Object
Constructor Details
#initialize(fixture_path:) ⇒ Load
Returns a new instance of Load.
6 7 8 |
# File 'lib/static_db/load.rb', line 6 def initialize(fixture_path:) @fixture_path = Pathname.new(fixture_path) end |
Instance Attribute Details
#fixture_path ⇒ Object (readonly)
Returns the value of attribute fixture_path.
4 5 6 |
# File 'lib/static_db/load.rb', line 4 def fixture_path @fixture_path end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/static_db/load.rb', line 10 def perform puts green("Loading fixtures ...") reenable_rake_tasks! Rake::Task["db:create"].invoke Rake::Task["db:schema:load"].invoke load_fixtures! puts green("Done!") rescue => e puts red("Failed to load fixtures: #{e.}") puts red("Exiting and skipping active_fixtures:dump!") $skip_active_fixtures_dump = true exit 1 end |