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

Override class-collection mapping?

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      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?

            Assignee:
            Unassigned Unassigned
            Reporter:
            trevorburnham Trevor Burnham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: