Sha256: b398daa72c48d6abd716ce172dca1dfbc4c3bb2548910b94673d62397a7c1bee

Contents?: true

Size: 523 Bytes

Versions: 9

Compression:

Stored size: 523 Bytes

Contents

# 
# ObjectID
# 
Mongo::ObjectID.class_eval do  
  def == other
    self.to_s == other.to_s
  end

  def to_yaml *args
    to_s.to_yaml *args
  end
end


# 
# Fixes
# 
if Object.const_defined?(:RAILS_ENV) and Object.const_get(:RAILS_ENV) != 'production'
  MongoMapper::Document::ClassMethods.class_eval do
    def ensure_index(name_or_array, options={})
    end
  end
end


MongoMapper::Plugins::Associations::InArrayProxy.class_eval do
  def delete(doc)
    ids.delete(doc.id)
    klass.delete(doc.id)
    reset
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails-ext-0.3.12 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.11 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.10 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.9 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.8 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.6 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.5 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.4 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.3 lib/mongo_mapper_ext/fixes.rb