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

Single Collection Inheritance

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.2
    • Affects Version/s: None
    • Component/s: None
    • None

      class A
      include Mongoid::Document
      field :name, type: String
      end

      class B < A
      def print
      puts "I'm instances are class B "
      end

      When I create an object:
      A.create(:_type => B)
      I receive an instance of сlass A.
      Why?

      P.S. Sorry for my English.

            Assignee:
            Unassigned Unassigned
            Reporter:
            malina malina
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: