Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Semi-hotfix for Rails configuration bug

At the time Bundler loads NullDB, Rails.root will return nil. We need to
defer calling Rails.root until after Rails loads; would be nice to not
redefine Configuration#project_root, but that does work.

Would not be an issue if people were required to put
`require 'nulldb/rails'` in their projects, perhaps the solution is
moving towards that.

Closes #16
  • Loading branch information...
commit fa3487a2eec39096814cc2d27e9a5a68e7562ace 1 parent 7988789
@woahdae woahdae authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/nulldb/rails.rb
View
3  lib/nulldb/rails.rb
@@ -1,3 +1,4 @@
require 'nulldb/core'
-NullDB.configure {|ndb| ndb.project_root = Rails.root}
+# Need to defer calling Rails.root because when bundler loads, Rails.root is nil
+NullDB.configure {|ndb| def ndb.project_root;Rails.root;end}
Please sign in to comment.
Something went wrong with that request. Please try again.