Using Rails 6, ActiveRecord, and Postgres
After retrieving an existing model from the database, I updated the model to have a "custom" field:
tc.update(
leafy_fields_attributes: [
{ name: "hs_city", type: :string}
]
)
Although, upon trying to pull the values (which I'd expect to be nil) I get an undefined method 'leafy_values' error. So no getter...
So I thought perhaps I had to assign values (even though that shouldn't be the case)
tc.leafy_values ={ "hs_city": 'Gallatin'}
But this threw basically the same error undefined method 'leafy_values=' so no setter...
But indeed the object did store the "custom" field:
tc.leafy_fields
=> #<Leafy::Schema:0x00007fcc0875f400 @fields=[#<Leafy::Field:0x00007fcc0875f3b0 @id="hs_city-eed709f9-fea3-47ad-97e1-5e81ef800a66", @metadata={}, @name="hs_city", @type="string">]>
Am I missing something from the Read me? Or perhaps another initializer/config?
Using Rails 6, ActiveRecord, and Postgres
After retrieving an existing model from the database, I updated the model to have a "custom" field:
Although, upon trying to pull the values (which I'd expect to be nil) I get an
undefined method 'leafy_values'error. So no getter...So I thought perhaps I had to assign values (even though that shouldn't be the case)
But this threw basically the same error
undefined method 'leafy_values='so no setter...But indeed the object did store the "custom" field:
Am I missing something from the Read me? Or perhaps another initializer/config?