Adding a monkey patch


#1

Hi

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.0/lib/active_record/connection_adapters/mysql_adapter.rb
(class Mysql adapter)

there is a call
def create_table(table_name, options = {}) #:nodoc:
super(table_name, options.reverse_merge(:options =>
“ENGINE=InnoDB”))

I have a monkey patch in the name active_record_ndbcluster.rb and it has

module ActiveRecord
module ConnectionAdapters
class MysqlAdapter
def create_table(table_name, options = {}) #:nodoc:
super(table_name, options.reverse_merge(:options =>
“ENGINE=NDBCLUSTER”))
end
end
end
end

now where do i place this patch.

when i placed it in ~/web/lib/

it doesn’t work. ~/web is the ruby on rails directory.

Thanks


#2

config/initializers :slight_smile:

and it works!!

Vinay Bg wrote:

Hi

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.0/lib/active_record/connection_adapters/mysql_adapter.rb
(class Mysql adapter)

there is a call
def create_table(table_name, options = {}) #:nodoc:
super(table_name, options.reverse_merge(:options =>
“ENGINE=InnoDB”))

I have a monkey patch in the name active_record_ndbcluster.rb and it has

module ActiveRecord
module ConnectionAdapters
class MysqlAdapter
def create_table(table_name, options = {}) #:nodoc:
super(table_name, options.reverse_merge(:options =>
“ENGINE=NDBCLUSTER”))
end
end
end
end

now where do i place this patch.

when i placed it in ~/web/lib/

it doesn’t work. ~/web is the ruby on rails directory.

Thanks