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

Fields from siblings in class inheritance are included in all classes

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

      Sorry wasn't sure how to write the description, but given a class structure somewhat like this:

      class UserIdentifier
        include Mongoid::Document
        class Facebook < UserIdentifier; end
        class Email < UserIdentifier
           field :subscribed, type: Boolean, default: true
        end
      end
      
      UserIdentifier::Facebook.create.as_document #=> {"subscribed" => true}
      

      Is the fact that the field was added to a different class yet applied to all siblings/parents a bug? It definitely goes against my expectations if it's working as designed.

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

              Created:
              Updated:
              Resolved: