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

Allow returning objects responding to :to_s from an Arbre block. #154

Closed

Conversation

utkarshkukreti
Copy link

Not sure if this is the best way to do this.

I wasted a few minutes trying to figure out why this wasn't working, until I found that only Strings were being accepted by the block.

column "Post Length" do |post|
  post.content.size
end

@ebeigarts
Copy link
Contributor

+1. I think the method name should also be changed from insert_text_node_if_string to insert_text_node, since it now accepts any Object with to_s method.

@mattvague
Copy link
Contributor

+1

@gregbell
Copy link
Contributor

Fixed on master in 9cb2b90

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

Successfully merging this pull request may close these issues.

4 participants