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

ar_innodb_row_format.rb initializer does not work with Rails 5 due to deprecation of alias_method_chain #1

Open
joshweir opened this issue Sep 26, 2017 · 0 comments

Comments

@joshweir
Copy link

As alias_method_chain is deprecated in Rails 5, I have rewritten the ar_innodb_row_format.rb initializer to make use of #prepend. I found more info on this type of conversion here.

ActiveSupport.on_load :active_record do
  module AbstractMysqlAdapterWithInnodbRowFormatDynamic
    def create_table(table_name, options = {})
      super(table_name,
            options.reverse_merge(
              :options => 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC'))
    end
  end

  ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
    .send(:prepend, AbstractMysqlAdapterWithInnodbRowFormatDynamic)
end

I'll submit a pull request for this.

joshweir added a commit to joshweir/utf8mb4_conversion_scripts that referenced this issue Sep 26, 2017
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

No branches or pull requests

1 participant