-
Notifications
You must be signed in to change notification settings - Fork 3
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
Attempt to support Migration and MigrationContext with Rails Version Dependency #21
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,27 @@ | |||
require "active_record" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module is moved into its own file from migrator.rb
@@ -0,0 +1,112 @@ | |||
require "active_record" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new migration context, as required by Rails 5.2
.
This will need some work as it must act as the new module does in rails; for now it is just a placeholder
@ryantownsend @paulspringett @adamdullenty I am not an ActiveRecord Savant, so would appreciate some guidance on getting this merged. Although it has a green build for I might suggest that we use the That could be a seperate PR ahead of this which would:
|
def self.included(base) | ||
base.class_eval do | ||
# Verbose form of alias_method_chain which is now deprecated in ActiveSupport. | ||
# | ||
# This replaces the original #annouce method with #announce_with_penthouse | ||
# but allows calling #annouce by using #announce_without_penthouse. | ||
alias_method :announce_without_penthouse, :announce | ||
alias_method :announce, :announce_with_penthouse | ||
end | ||
end | ||
|
||
def announce_with_penthouse(message) | ||
announce_without_penthouse("#{message} - #{current_tenant}") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def self.included(base) | |
base.class_eval do | |
# Verbose form of alias_method_chain which is now deprecated in ActiveSupport. | |
# | |
# This replaces the original #annouce method with #announce_with_penthouse | |
# but allows calling #annouce by using #announce_without_penthouse. | |
alias_method :announce_without_penthouse, :announce | |
alias_method :announce, :announce_with_penthouse | |
end | |
end | |
def announce_with_penthouse(message) | |
announce_without_penthouse("#{message} - #{current_tenant}") | |
end | |
def announce(message) | |
super("#{message} - #{current_tenant}") | |
end |
end | ||
end | ||
|
||
ActiveRecord::Migration.send(:include, Penthouse::Migration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ActiveRecord::Migration.send(:include, Penthouse::Migration) | |
ActiveRecord::Migration.send(:prepend, Penthouse::Migration) |
As of Rails 5.2, the
migration
module has been changed.closes #15
Instead of having paths, it now has a separate
ActiveRecord::MigrationContext
.This PR is the initial work to build for rails
5.2.3