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

Handle disabling timeouts in indirect ActiveRecord::Migration subclasses #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jturkel
Copy link
Contributor

@jturkel jturkel commented Jul 18, 2017

Attempts to disable timeouts in non-direct subclasses of ActiveRecord::Migration fail in Rails 4.x with the following exception:

     NoMethodError:
       undefined method `say' for nil:NilClass
     # /Users/jturkel/.rvm/gems/ruby-2.3.4@activerecord-safer_migrations/gems/activerecord-4.2.9/lib/active_record/migration.rb:416:in `method_missing'
     # ./lib/active_record/safer_migrations/migration.rb:43:in `disable_lock_timeout!'

This was fixed in Rails 5.0 with rails/rails@f37d92c. This PR works around the issue in Rails 4.x by explicitly defining the ActiveRecord::Migration.say method which avoids the Rails bug in ActiveRecord::Migration.method_missing. The implementation of say was copied directly from Rails (with some rubocop fixes applied).

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.

1 participant