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)