Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fndsit/allow engines #1

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/data_migrate/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def config
end

class Config
attr_accessor :data_migrations_path, :db_configuration, :spec_name
attr_accessor :data_migrations_gen_path, :data_migrations_path, :db_configuration, :spec_name

def initialize
@data_migrations_path = "db/data/"
@data_migrations_gen_path = "db/data/"
@db_configuration = nil
@spec_name = nil
end
Expand Down
2 changes: 1 addition & 1 deletion lib/data_migrate/data_migrator_five.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
module DataMigrate
class DataMigrator < ActiveRecord::Migrator
def self.migrations_paths
[DataMigrate.config.data_migrations_path]
Array.wrap(DataMigrate.config.data_migrations_path)
end

def self.assure_data_schema_table
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/data_migration/data_migration_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def data_migrations_file_path
end

def data_migrations_path
DataMigrate.config.data_migrations_path
DataMigrate.config.data_migrations_gen_path || DataMigrate.config.data_migrations_path
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

context 'when custom data migrations path has a trailing slash' do
before do
DataMigrate.config.data_migrations_path = 'abc/'
DataMigrate.config.data_migrations_gen_path = 'abc/'
end

it 'returns correct file path' do
Expand All @@ -45,7 +45,7 @@

context 'when custom data migrations path does not have a trailing slash' do
before do
DataMigrate.config.data_migrations_path = 'abc'
DataMigrate.config.data_migrations_gen_path = 'abc'
end

it 'returns correct file path' do
Expand Down