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 support for jsonb fields #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

madhums
Copy link

@madhums madhums commented Oct 23, 2024

No description provided.

@andreibondarev
Copy link
Member

@madhums Could you please add a spec for this case?

@madhums
Copy link
Author

madhums commented Oct 29, 2024

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
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, yes.

Copy link
Member

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.

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.

2 participants