How to override rake database tasks in rails 4

387 views Asked by At

I have a rails 4.2.1 project on the jRuby platform connected to oracle with the following gem dependency:

gem 'activerecord-oracle_enhanced-adapter', git: "[email protected]:rsim/oracle-enhanced.git", branch: "rails42"

But when I run rake tasks like rake db:migrate, it invokes the default activerecord rake task instead of the ones defined in this gem. How do I make rails execute rake tasks from this gem instead of the default ActiveRecord tasks

1

There are 1 answers

0
Swaroop On

need to use this:

require 'active_record/connection_adapters/oracle_enhanced/database_tasks'

instead of rails 3.2 style:

load 'active_record/connection_adapters/oracle_enhanced.rake'