1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Fix Style/UnlessElse

This commit is contained in:
Jared Beck 2016-03-05 16:56:31 -05:00
parent 9bc4dabaed
commit 31f64c82d8
2 changed files with 6 additions and 10 deletions

View file

@ -395,8 +395,3 @@ Style/TrailingWhitespace:
Exclude:
- 'test/dummy/app/models/person.rb'
- 'test/paper_trail_test.rb'
# Offense count: 1
Style/UnlessElse:
Exclude:
- 'lib/generators/paper_trail/install_generator.rb'

View file

@ -38,12 +38,13 @@ module PaperTrail
def add_paper_trail_migration(template)
migration_dir = File.expand_path('db/migrate')
unless self.class.migration_exists?(migration_dir, template)
migration_template "#{template}.rb", "db/migrate/#{template}.rb"
if self.class.migration_exists?(migration_dir, template)
warn(
"ALERT: Migration already exists named '#{template}'." +
" Please check your migrations directory before re-running"
)
else
warn("ALERT: Migration already exists named '#{template}'." +
" Please check your migrations directory before re-running")
migration_template "#{template}.rb", "db/migrate/#{template}.rb"
end
end
end