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

Inheritance behavior is really weird!?

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

      I have a User class at the base.
      Customer inherits from User.
      Then Customer::Private inherits from Customer and embeds a :person (Person class).

      Now If I create a new User it complains that I don't have a #person method. I can only make it work like this:

      <pre>
      class User
      include Mongoid::Document

      def person *args
      end

      def company *args
      end
      end
      </pre>

      Why I need these getter methods and with multiple args is beyond me! Seems like it requires the superclass as a kind of Interface!?

            Assignee:
            Unassigned Unassigned
            Reporter:
            kristianmandrup Kristian Mandrup
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: