Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed mongoid support

  • Loading branch information...
commit a54c36112f97d2b025c3119bbc7e12c6c1deb4ff 1 parent b980bc4
@no-dashes no-dashes authored
Showing with 6 additions and 5 deletions.
  1. +1 −1  Gemfile
  2. +5 −4 lib/initializers/mongoid.rb
View
2  Gemfile
@@ -14,5 +14,5 @@ group :development, :test do
gem 'capybara'
gem 'launchy'
gem 'database_cleaner'
- #gem 'mongoid'
+ gem 'mongoid'
end
View
9 lib/initializers/mongoid.rb
@@ -21,10 +21,11 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
-#require 'mongoid'
-if Object.const_defined?("Mongoid")
- # This is hopefully wrong soonish: raise "Mongoid support is buggy like hell as of now"
- module Mongoid::Document
+# This is somewhat ugly, for it creates the Mongoid module, no matter
+# whether it's about to be used. So you will find an empty Mongoid
+# module in every Tabulatr project.
+module Mongoid
+ module Document
module ClassMethods
def find_for_table(params, opts={}, &block)
Tabulatr::Finder.find_for_table(self, params, opts, &block)
Please sign in to comment.
Something went wrong with that request. Please try again.