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

Fix migrations in tests for rails 5.2 #409

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

fatkodima
Copy link
Contributor

Rails 5.2.rc1 introduced some breaking changes for ActiveRecord::Migrator, so this PR fixes tests according to new changes.

@@ -17,4 +17,12 @@ def create_versions(n = 2)
end
end

def run_migrations(direction, migrations_paths, target_version = nil)
if Rails.version >= '5.2.0.0'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will fail once 5.2.0 is out, since '5.2.0' >= '5.2.0.0' => false.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ouch, extra zero.
Such Rails.version >= '5.2.0' will not work for .beta2, after which change was introduced. Should I bother of exactly greater than .beta2 or is Rails.version >= '5.2.0' enough?

Copy link
Collaborator

Choose a reason for hiding this comment

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

perhaps Rails.version.start_with? '5.2' for now, and change it later if needed for 6?

@fatkodima fatkodima force-pushed the fix-tests-for-rails5.2 branch from 5df7c3b to 4c61d32 Compare January 31, 2018 21:05
@fatkodima
Copy link
Contributor Author

Updated this to use exact version:

  • to allow working on all 5.2 betas
  • and to avoid updating code for new major rails releases as proposed in

perhaps Rails.version.start_with? '5.2' for now, and change it later if needed for 6?

Copy link
Collaborator

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Thanks @fatkodima !

@tbrisker tbrisker merged commit fda37bb into collectiveidea:master Feb 1, 2018
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.

2 participants