madeintandem / jsonb_accessor

Adds typed jsonb backed fields to your ActiveRecord models.
MIT License
1.1k stars 93 forks source link

Fields are not accepting without default values rails 7 #140

Closed anushamummina closed 2 years ago

anushamummina commented 2 years ago

Thanks for the wonderful gem, Awesome work.

I am trying to use this gem in rails 7 project, i am facing below issue.

When initialising data the attributes are not showing if we don't specify default values.

example: jsonb_accessor: :data, title: :string, content: [:string, { array: true, default: []} ]

In the above example it is only considering content as json field but not showing title as it doesn't have any default value.

Please help me to solve this issue.

Thanks

haffla commented 2 years ago

Hey @anushamummina

I am not sure I understand the problem. I just added tests for Rails 7: https://github.com/madeintandem/jsonb_accessor/runs/4968842021?check_suite_focus=true

I also tested in one of my Rails 7 apps and I don't see a problem.

What do you mean by "the attributes are not showing"?

haffla commented 2 years ago

Closing for inactivity. Feel free to reopen and explain in more detail what's the issue @anushamummina.