Skip to content

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

Description

@joshweir

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions