-
Notifications
You must be signed in to change notification settings - Fork 21
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 support for jsonb fields #53
base: master
Are you sure you want to change the base?
Conversation
@madhums Could you please add a spec for this case? |
Do you think this could be useful? On a second thought, I can expose some of the fields through model attributes without exporting the json field itself. So I am considering closing this. |
@@ -52,6 +52,8 @@ def record_attribute(record, attribute_key, attribute_type) | |||
field.truncate | |||
when Administrate::Field::Time.to_s | |||
field.data.strftime("%I:%M%p").to_s if field.data | |||
when Administrate::Field::JSONB.to_s | |||
field.to_json | |||
else | |||
field.to_s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does field.to_s
below produce the same output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I get an Administrate object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then this fix would make sense to me. Would this need to be included as a dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I'm not sure it makes sense to do.
No description provided.