Class: DatabaseCleaner::ActiveRecord::Seeded::Adapter::MYSQL
- Inherits:
-
Object
- Object
- DatabaseCleaner::ActiveRecord::Seeded::Adapter::MYSQL
- Defined in:
- lib/database_cleaner/active_record/seeded/adapter/mysql.rb
Constant Summary collapse
- IGNORE_TABLES =
%w(schema_migrations)
Instance Attribute Summary collapse
-
#seeds_file_path ⇒ Object
readonly
Returns the value of attribute seeds_file_path.
Instance Method Summary collapse
- #dump_database_to_fixtures_file ⇒ Object
-
#initialize(seeds_file_path) ⇒ MYSQL
constructor
A new instance of MYSQL.
- #inject_seeds_from_fixtures_file ⇒ Object
Constructor Details
#initialize(seeds_file_path) ⇒ MYSQL
Returns a new instance of MYSQL.
17 18 19 |
# File 'lib/database_cleaner/active_record/seeded/adapter/mysql.rb', line 17 def initialize(seeds_file_path) @seeds_file_path = seeds_file_path end |
Instance Attribute Details
#seeds_file_path ⇒ Object (readonly)
Returns the value of attribute seeds_file_path.
15 16 17 |
# File 'lib/database_cleaner/active_record/seeded/adapter/mysql.rb', line 15 def seeds_file_path @seeds_file_path end |
Instance Method Details
#dump_database_to_fixtures_file ⇒ Object
25 26 27 |
# File 'lib/database_cleaner/active_record/seeded/adapter/mysql.rb', line 25 def dump_database_to_fixtures_file `mysqldump --user=#{user} --host=#{host} --port=#{port} --compact #{ignore_tables} --no-create-info=TRUE #{database} > #{seeds_file_path}` end |
#inject_seeds_from_fixtures_file ⇒ Object
21 22 23 |
# File 'lib/database_cleaner/active_record/seeded/adapter/mysql.rb', line 21 def inject_seeds_from_fixtures_file `mysql --user=#{user} --host=#{host} --port=#{port} --database=#{database} < #{seeds_file_path}` end |