Sha256: a95ff9d12d7f873a37305bc1c3c3b97fa408dc61d49de9347f83b675735bafc2

Contents?: true

Size: 201 Bytes

Versions: 3

Compression:

Stored size: 201 Bytes

Contents

if defined?(MongoMapper::Document)
  MongoMapper::Document.class_eval do
    def dom_id
      new_record? ? "new_#{self.class.name.underscore}" : "#{self.class.name.underscore}_#{id}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails-ext-0.2.5 lib/rails_ext/mongo_mapper.rb
rails-ext-0.2.4 lib/rails_ext/mongo_mapper.rb
rails-ext-0.2.3 lib/rails_ext/mongo_mapper.rb