Sha256: a01b475b784325543bd3fb46a88e7b73b941383bee3a6059a084cbeb4866a58e

Contents?: true

Size: 501 Bytes

Versions: 20

Compression:

Stored size: 501 Bytes

Contents

module MongoMapper
  module RailsCompatibility
    module EmbeddedDocument
      def self.included(model)
        model.class_eval do
          extend ClassMethods
          
          alias_method :new_record?, :new?
        end

        class << model
          alias has_many many
        end
      end

      module ClassMethods
        def column_names
          keys.keys
        end
        
        def human_name
          self.name.demodulize.titleize
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
tpitale-mongo_mapper-0.6.9 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.30 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.29 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.23 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.22 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.16 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.8 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.14 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.7 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.6 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.12.4 lib/mongo_mapper/rails_compatibility/embedded_document.rb
danielharan-mongo_mapper-0.6.5 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.5 lib/mongo_mapper/rails_compatibility/embedded_document.rb
webbynode-mongo_mapper-0.6.4 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.4 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.3 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.2 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.1 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-unstable-2009.11.18 lib/mongo_mapper/rails_compatibility/embedded_document.rb
mongo_mapper-0.6.0 lib/mongo_mapper/rails_compatibility/embedded_document.rb