customink / secondbase

Seamless second database integration for Rails.
MIT License
220 stars 31 forks source link

fix rake tasks for rails engine #64

Closed senid231 closed 2 months ago

senid231 commented 5 years ago

When you are developing rails engine which has connects with two databases you don't have ordinary rails tasks like db:migrate db:structure:load etc. They are moved into app namespace.

so instead of rake db:migrate you need to right rake app:db:migrate.

when you use gem with railtie that has rake tasks in rails engine those task namespaced into app too. Problem appears when you want to run another rake task inside of yours. For example when we inside app namespace we need to run app:db:migrate instead of `db:migrate.

in this PR I've solved this problem in a same way as active_record does - just call tasks using name related to current db namespace

metaskills commented 5 years ago

Hmm... mind adding a commit where you add this to the travis.yml file?

before_install:
  - gem install bundler -v 1.17.3
senid231 commented 5 years ago

@metaskills looks like sqlite3 is missing I think CI should be fixed in a separate MR

I will rebase this one after that

metaskills commented 5 years ago

Yea, I can work on that in a few days.