-
Notifications
You must be signed in to change notification settings - Fork 34
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
Is there a way to limit or exclude a verbose fields? (i.e. large JSON values) #66
Comments
Hmm, I don't think we have a build in way to do this today. @paddor correct me if I'm wrong. This does sound like a useful improvement we should add. |
|
This would be really helpful on models with geometry attributes that can take hundreds of lines. |
ActiveRecord offers an easy way to limit output of long attributes: class ApplicationRecord < ActiveRecord::Base
def format_for_inspect(name, value)
value = value.to_s.truncate(60).inspect if value.is_a?(RGeo::Feature::Instance)
super(name, value)
end
end |
I haven't found the strategy has a limitation which is probably obvious, though — sometimes I need to work with the huge array field — so I would love to have this feature also. |
Hi, thanks for forking, maintaining, and improving this project. I was really happy to see it was being taken care of. 🙏
I'm using Rails, and my User model has a large JSON field from redux-token-auth. When I run
ap User.first
, I get a hugeuser.tokens
being a very large JSON field.ap
to limit just that field? Or exclude that field?Model.amazing_print_config
, i.e.Example
This problem is exacerbated by the nested printing, i.e. if I do
ap Organiation.first
, a huge part of the output is the associated User object and it's largeuser.tokens
JSON field.The text was updated successfully, but these errors were encountered: