Hi @pfaffman
Thanks for feedback, but I am not sure if I am following it, could you please give example.
And also on the rails console if I do
[10] pry(main)> user = **User** .find( **1** )
[11] pry(main)> pp user.custom_fields
(2.5ms) SELECT "user_custom_fields"."name", "user_custom_fields"."value" FROM "user_custom_fields" WHERE "user_custom_fields"."user_id" = 1 ORDER BY id asc
{"xxxxxxxxxxxxxxxx"=>"2018-06-16 12:23:39 UTC",
"test_two"=>"1234567",
"fountain_cake"=>"2018-06-16 13:16:25 UTC"}
=> **{ **"** xxxxxxxxxxxxxxxx **"** => **"** 2018-06-16 12:23:39 UTC **"** , **"** test_two **"** => **"** 1234567 **"** , **"** fountain_cake **"** => **"** 2018-06-16 13:16:25 UTC **"** }**
I can see the custom fields I added,
But on the plugin:
def custom_field_test
begin
cf_time = Time.zone.now
user = User.find(1)
user.custom_fields['fountain_cake'] = cf_time
user.save!
user_after_update = User.find(1)
json = serialize_data(user_after_update, UserSerializer, root: false)
render json: { user: json }
rescue StandardError => e
render_json_error e.message
end
end
It returns the custom_fields as empty object, any thought ?