From 380bea3a2ff464e977e9d7511b54390b920f7537 Mon Sep 17 00:00:00 2001 From: ahoward Date: Mon, 23 Jul 2012 00:34:29 -0600 Subject: [PATCH] barely using moped --- README.md | 4 ++-- lib/mongoid-grid_fs.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c67bb3d..857380f 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ ref: http://www.mongodb.org/display/DOCS/GridFS+Specification it has the following features: -- implementation is on top of mongoid for portability. moped (the drive) - is barely used +- implementation is on top of mongoid for portability. moped (the driver) is + barely used - simple, REST-like api diff --git a/lib/mongoid-grid_fs.rb b/lib/mongoid-grid_fs.rb index ddb50a5..8c0939e 100644 --- a/lib/mongoid-grid_fs.rb +++ b/lib/mongoid-grid_fs.rb @@ -340,7 +340,7 @@ class GridFS self.default_collection_name = "#{ prefix }.chunks" field(:n, :type => Integer, :default => 0) - field(:data, :type => Moped::BSON::Binary) + field(:data, :type => (defined?(Moped) ? Moped::BSON::Binary : BSON::Binary)) belongs_to(:file, :foreign_key => :files_id, :class_name => file_model_name)