Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haml_object_ref missing from v6 #1097

Closed
timdiggins opened this issue Oct 4, 2022 · 2 comments
Closed

haml_object_ref missing from v6 #1097

timdiggins opened this issue Oct 4, 2022 · 2 comments

Comments

@timdiggins
Copy link
Contributor

timdiggins commented Oct 4, 2022

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 ).

@k0kubun k0kubun closed this as completed in 78811ed Oct 5, 2022
@k0kubun
Copy link
Member

k0kubun commented Oct 5, 2022

This removal seems to be not a carefully designed change but an oversight. I just resurrected this feature in 6.0.5.

@timdiggins
Copy link
Contributor Author

Wow - so fast thank you!

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Oct 12, 2022
https://build.opensuse.org/request/show/1010035
by user coolo + dimstar_suse
updated to version 6.0.6
 see installed CHANGELOG.md
  ## 6.0.6

  * Prevent CRuby from accidentally using the Ruby implementation fallback
    * Reversing what v6.0.3 and v6.0.4 did, but still supporting Wasm.

  ## 6.0.5

  * Resurrect `#haml_object_ref` support in an object reference [#1097](haml/haml#1097)
    * This was removed in 6.0.0, and added back in this version.
  * Stop warning `remove_whitespace: true` option.

  ## 6.0.4

  Released on October 2, 2022
  ([diff](haml/haml@v6.0.3...v6.0.4)).

  * Fix a parse failure of `%` in attributes [#1096](haml/haml#1096)
  * Add another fallback from C to Ruby for Wasm.

  ## 6.0.3

  Released on September 28, 2022
  ([diff](https://github.com/h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants