Sha256: 9270834cf621c08a1ba8f13f531062d764014ecf1b605c5135a8ba0356273307

Contents?: true

Size: 541 Bytes

Versions: 19

Compression:

Stored size: 541 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

19 entries across 19 versions & 2 rubygems

Version Path
crystal-ext-0.0.3 lib/mongo_mapper_ext/hacks/fixes.rb
crystal-ext-0.0.2 lib/mongo_mapper_ext/hacks/fixes.rb
crystal-ext-0.0.1 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.29 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.28 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.27 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.25 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.24 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.23 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.22 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.21 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.20 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.19 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.18 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.17 lib/mongo_mapper_ext/hacks/fixes.rb
rails-ext-0.3.16 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.15 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.14 lib/mongo_mapper_ext/fixes.rb
rails-ext-0.3.13 lib/mongo_mapper_ext/fixes.rb