janko-m/sinatra-activerecord — pull request #32 by mcls (2014-04-15 19:04:29+00:00)
Title: Fixes issue #29, uninitialized constant ActiveRecord::Tasks::DatabaseTasks::Rails

In ActiveRecord 4.1.0 the default db_dir is set using Rails. So we must
make sure that we set db_dir before calling it to prevent an error from
being raised (because of Rails not being defined).

The relevant ActiveRecord code can be found here:
https://github.com/rails/rails/blob/v4.1.0/activerecord/lib/active_record/tasks/database_tasks.rb#L53-L55

The error from the issue can be reproduced by reverting the method bodies of `db_dir` & `db_dir=` to their old versions and running the specs.