Closed rusikf closed 2 years ago
@rusikf I think this is actually a Rails issue. Even if you define name
and email
as simple ActiveModel attributes the assignment will fail
@caiohsramos Thank's a lot! As I read the latest update of this rails issue, we cannot use becomes
to change STI to sibling class. => In our example, we don't have a beautiful way to change the type and set jsonb attributes. :thinking:
Closing because it seems that this isn't a jsonb_accessor issue.
Hi @haffla and @caiohsramos, thank's for your gem! Please advise about this issue:
If we have STI ActiveRecord models and run 'becomes!' to change the STI type:
We receive the error "NoMethodError: undefined method `name'"
Question: Is it possible to reload attributes for the instance ( without reload! because of DB transaction ) ??
I tried
instance.class.jsonb_accessor :data, name: :string; instance.update!(...)
, but instance doesn't refreshed after changes in the class.Thanks! :man_mechanic: