Module: VersionedSeeds::Utils
- Defined in:
- lib/versioned_seeds/utils.rb
Class Method Summary collapse
Class Method Details
.db_config ⇒ Object
11 12 13 |
# File 'lib/versioned_seeds/utils.rb', line 11 def self.db_config @db_config = Rails.application.config.database_configuration[Rails.env] end |
.load_sql(path) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/versioned_seeds/utils.rb', line 4 def self.load_sql(path) sql_file = VersionedSeeds.root_path + 'db/seeds/' + path db_password = db_config['password'] system "RAILS_ENV='#{Rails.env}' bundle exec rails dbconsole -p '#{db_password}' < '#{sql_file}'" end |