Skip to content

Commit

Permalink
Merge pull request #136 from ifad/chore/do-not-remove-header-comments…
Browse files Browse the repository at this point in the history
…-twice

Do not try to remove comments twice
  • Loading branch information
tagliala authored Feb 8, 2022
2 parents 17447b6 + 41c94a7 commit 703426f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_record/tasks/chronomodel_database_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def structure_dump(*arguments)
sql = File.read(filename).gsub(/CREATE SCHEMA (?!IF NOT EXISTS)/, '\&IF NOT EXISTS ')
File.open(filename, 'w') { |file| file << sql }

remove_sql_header_comments(filename)
remove_sql_header_comments(filename) if ActiveRecord::VERSION::STRING < '5.1'
end

def data_dump(target)
Expand Down
1 change: 1 addition & 0 deletions spec/aruba/rake_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

it { expect(last_command_started).to be_successfully_executed }
it { expect('db/test.sql').to be_an_existing_file }
it { expect('db/test.sql').not_to have_file_content(/\A--/) }
end

describe 'db:schema:load' do
Expand Down

0 comments on commit 703426f

Please sign in to comment.