Skip to content

Better support for inheritance #194

Open
@mvz

Description

Right now, inheriting models from a superclass is awkward, because you're supposed to include HapppyMapper in each subclass to copy and inherit the attribute lists defined on the class

So you end up with this:

class Super
  include HappyMapper
end

# And for each subclass:
class SubClass < Super
  include HappyMapper
end

This will work but is awkward:

class Super
  include HappyMapper

  def self.inherited(base)
    super
    base.include(HappyMapper)
  end
end

HappyMapper should really define the inherited hook itself.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions