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

Use belongs_to instead of embedded_in in model generator

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 7.1.2, 7.0.8
    • Affects Version/s: None
    • Component/s: None

      When a user runs:

      rails g scaffold Comment name:string message:string post:belongs_to
      

      ... the comment is marked as being emdedded in the post.

      Since Mongoid supports belongs_to, it seems less surprising for belongs_to to generate that exact relationship, rather than embedded_in.

      SO question: https://stackoverflow.com/questions/61760838/use-of-belongs-to-vs-embedded-in-in-rails-mongoid

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: