Extending an embedded object with a Module

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 2.4.9
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I've noticed the following.

      If I do:

      user = User.first.all
      user.extend Role
      user.is_a? Role
      

      returns true as expected.

      If I have an objected that is Embedded in the User class like:

      def User
         embeds_one :profile
      end
      def Profile
        embedded_in :user
      end
      

      and I do the following:

      profile = User.all.first.profile
      profile.user.extend Role
      profile.user.is_a? Role
      

      it returns false.

      I've been struggling to understand why, and I'm wondering whether mongoid is producing this strange behaviour?

            Assignee:
            Durran Jordan
            Reporter:
            stantona
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: