Skip to content

haml_object_ref missing from v6 #1097

@timdiggins

Description

@timdiggins

REFERENCE.md still has a reference to implementing haml_object_ref

And this is very useful inside of rails (either with STI and other forms of polymorphic models, and also decorators (Draper and others)) but also outside too.

However it doesn't seem to work and indeed it seems to have disappeared from the code: https://github.com/haml/haml/search?q=haml_object_ref&type=code

> git checkout v5.2.2
> grep haml_object_ref **/*.*
CHANGELOG.md:  for a given object by implementing the `haml_object_ref` method on that object.
REFERENCE.md:class, you can implement the `haml_object_ref` method on the object.
REFERENCE.md:      def haml_object_ref
lib/haml/attribute_builder.rb:          if ref.respond_to?(:haml_object_ref)
lib/haml/attribute_builder.rb:            ref.haml_object_ref
test/cases/object_reference_test.rb:    def haml_object_ref

> git checkout v6.0.0
> grep haml_object_ref **/*.*
CHANGELOG.md:  for a given object by implementing the `haml_object_ref` method on that object.
REFERENCE.md:class, you can implement the `haml_object_ref` method on the object.
REFERENCE.md:      def haml_object_ref
test/haml/engine_test.rb:    def haml_object_ref

There is no mention of it being dropped in the CHANGELOG.md.

Is there a replacement for this?

If yes, needs some documentation.

If not, can we bring it back? (happy to try a PR but can you give a suggestion of which test file to start with ).

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