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

Additional help messaging to help the user resolve a conflicted migration #16212

Merged

Conversation

aantix
Copy link
Contributor

@aantix aantix commented Jul 18, 2014

Added additional help messaging for command line scaffold generation. When a migration already exists for the resource, the user is now alerted that they are able to skip the conflicted migration file via the --skip option.

This functionality already exists; I've just updated the help output to remind the user that skipping the migration creation is an option as well.

…ted and a migration already exists for the resource.

The user is now alerted that they are able to skip the conflicted migration file via the --skip option.
@@ -55,7 +55,8 @@ def on_conflict_behavior(&block)
else
say_status :conflict, :red
raise Error, "Another migration is already named #{migration_file_name}: " +
"#{existing_migration}. Use --force to replace this migration file."
"#{existing_migration}. Use --force to replace this migration" +
" or --skip to ignore conflicted file."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are changing this already, should we use only one string here instead of concat a few. Something like:

raise Error, <<-MSG
Another migration is already named #{migration_file_name}:
 #{existing_migration}. Use --force to replace this migration 
 or --skip to ignore conflicted file.
MSG

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arthurnn Good idea. I've made a modification to eliminate the string concatenation.

@arthurnn
Copy link
Member

👍 ..
Final thoughts @rafaelfranca

@rafaelfranca rafaelfranca merged commit cc1ad78 into rails:master Jul 18, 2014
rafaelfranca added a commit that referenced this pull request Jul 18, 2014
…elp_messaging

Additional help messaging to help the user resolve a conflicted migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants