I had Paper Trail Gem nicely set up with my basic model Article which had a text
column called body
. However, after I have implemented Action Text to my application and removed the column body
from the Article model, I can't get Paper Trail to track changes in associated body
column. How can I get this to work?
Disclaimer: I am a newbie to Rails.
Article.rb
...
has_rich_text :body
has_paper_trail
...
Articles Schema (after deleting :body column)
create_table "articles", force: :cascade do |t|
t.string "title"
t.string "slug"
t.datetime "archived_at"
t.datetime "published_at"
...
end
Action Text Schema
create_table "action_text_rich_texts", force: :cascade do |t|
t.string "name", null: false
t.text "body"
t.string "record_type", null: false
t.bigint "record_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
end
I'd love to return the same functionality to the app as before where I was able to see the changes made in the body of the Article. E.g. someone added a sentence, deleted a word, etc..
ActionTextRichText
model available? if so, maybe you can addhas_paper_trail
to it β Summertree