Class: StaticDb::Dump
- Inherits:
-
Object
- Object
- StaticDb::Dump
- Defined in:
- lib/static_db/dump.rb
Instance Attribute Summary collapse
-
#fixture_path ⇒ Object
readonly
Returns the value of attribute fixture_path.
-
#models_to_be_saved ⇒ Object
readonly
Returns the value of attribute models_to_be_saved.
Instance Method Summary collapse
-
#initialize(fixture_path:) ⇒ Dump
constructor
A new instance of Dump.
- #perform ⇒ Object
Constructor Details
#initialize(fixture_path:) ⇒ Dump
Returns a new instance of Dump.
6 7 8 9 |
# File 'lib/static_db/dump.rb', line 6 def initialize(fixture_path:) @fixture_path = Pathname.new(fixture_path) @models_to_be_saved = models end |
Instance Attribute Details
#fixture_path ⇒ Object (readonly)
Returns the value of attribute fixture_path.
4 5 6 |
# File 'lib/static_db/dump.rb', line 4 def fixture_path @fixture_path end |
#models_to_be_saved ⇒ Object (readonly)
Returns the value of attribute models_to_be_saved.
4 5 6 |
# File 'lib/static_db/dump.rb', line 4 def models_to_be_saved @models_to_be_saved end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/static_db/dump.rb', line 11 def perform exit 1 if $skip_active_fixtures_dump reenable_rake_tasks! validate_records! puts green("Dumping fixtures ...") dump_fixtures! Rake::Task["db:drop"].invoke puts green("Done!") end |