Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-160

Override class-collection mapping?

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      Suppose I have a MongoDB collection called tests. The natural way to map to documents in that collection with MongoDB would be

      class Test
      include Mongoid::Document
      ...
      end

      but this is impossible, because Test is a reserved word in Rails. How do I create a class with a different name that Mongoid will map to tests?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: