As introduced in #11, to support newer Rails we are checking whether module_parent is defined. However this is duplicated 4 times throughout the codebase, and we could just implement module_parent to remove duplication. However it may increase complexity and readability and needs to be be further evaluated.