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

Improve GlobalID::Identification usage with associations

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Associations

      GlobalID::Identification is used in rails to serialize any record with an id method and find class method, which is the case of classes including Mongoid::Document.

      The benefit of including GlobalID::Identification would be e.g. that you can directly use documents with ActiveJob.

      I already included the module in my own project and it doesn't seem to pose any problem. It is also pretty straightforward:

      lib/mongoid/railtie.rb

      module Mongoid::Document
        include GlobalID::Identification
      end
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            Aethelflaed Aethelflaed [X]
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: