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

Add back pretty formatting of non-symbol attributes. #4538

Merged

Conversation

kaspth
Copy link
Contributor

@kaspth kaspth commented Jul 19, 2016

3efb359, switched around a bunch of code, but also scoped pretty_format-ing to only
symbol attributes.

This broke formatting in our app. In Active Admin v1.0.0.pre2 code like:

show do
  attributes_table do
    row :mobile_subscription do
      subscription # ActiveRecord::Base object.
    end
  end
end

would auto link the returned model, but pre4 merely returns an inspect like output.

I think scoping pretty_format to only symbol attributes was an oversight as the
method clearly knows how to handle lots of different objects.

This refines format_attribute so we can still get nice status tags for boolean
fields, but get pretty formatted output for the rest of the values like pre2 and
earlier did.

@kaspth
Copy link
Contributor Author

kaspth commented Jul 19, 2016

Okay, I was a little too quick to call it an oversight for my own good. Sorry about that! ❤️

I do think it would be nice to do someting about this, since the behavior in pre4 doesn't match the one in pre2 as shown above.

3efb359, switched around a bunch of code, but also scoped `pretty_format`-ing to only
symbol attributes.

This broke formatting in our app. In Active Admin v1.0.0.pre2 code like:

```ruby
show do
  attributes_table do
    row :mobile_subscription do
      subscription # ActiveRecord::Base object.
    end
  end
end
```

would auto link the returned model, but pre4 merely returns a `inspect` like output.

I think scoping `pretty_format` to only symbol attributes was an oversight as the
method clearly knows how to handle lots of different objects.

This refines `format_attribute` so we can still get nice status tags for boolean
fields, but get pretty formatted output for the rest of the values like pre2 and
earlier did.
@kaspth kaspth force-pushed the repretty-non-symbol-attributes branch from a9d143d to 91392b7 Compare July 23, 2016 15:11
@timoschilling timoschilling merged commit 5522892 into activeadmin:master Aug 10, 2016
@kaspth kaspth deleted the repretty-non-symbol-attributes branch August 10, 2016 17:47
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.

None yet

2 participants