# migration
class AddDataToPosts < ActiveRecord::Migration[6.1]
def change
add_column :posts, :data, :jsonb, default: {}
end
end
# model:
class Post < ApplicationRecord
jsonb_accessor :data,
body: :string,
sending_method: string
end
Gem version 1.3.2
Rails version 6.1.4
Ruby version 2.6.7
We've done the following:
Gem version 1.3.2 Rails version 6.1.4 Ruby version 2.6.7
When I try to do the following:
I get the error message
UNHANDLED ERROR unknown attribute 'body' for Post.
This is the param:
#<ActionController::Parameters { "sending_method"=>"email", "body"=>"<div>Fake body</div>"} permitted: true>
However, when I do this, it works