Skip to content

Issue with conditionals when extending base Serializable::Resource class directly in 0.2.1 #80

Description

@richmolj

I believe this commit, which changed from prepend to extend, broke the conditional support. I noticed this when trying to upgrade jsonapi_compliable - my if procs no longer get called, which broke extra_fields support.

The expectation is that I will get this overridden #requested_attributes, but debugging the code I see this is never called. The original #requested_attributes method is called.

I'm not sure how specs are passing, because this script mimics the same pattern and illustrates the problem:

classFoodefbar'original bar'endendmoduleMixdefself.extended(klass)klass.class_evaldoincludeInstanceMethodsendendmoduleInstanceMethodsdefbar'overridden bar'endendendFoo.extendMixputsFoo.new.bar#=> 'original'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions