Skip to content

Commit

Permalink
Semi-hotfix for Rails configuration bug
Browse files Browse the repository at this point in the history
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 nulldb#16
  • Loading branch information
woahdae committed Dec 5, 2011
1 parent 7988789 commit fa3487a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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}

0 comments on commit fa3487a

Please sign in to comment.