I am using rails 6.1.4 and added transalations table to post via this migration
class TransalatePosts < ActiveRecord::Migration[6.1]
def change
def self.up
Post.create_translation_table!({
:title => :string,
:body => :text
}, {
:migrate_data => true,
:remove_source_columns => true
})
end
def self.down
Post.drop_translation_table! :migrate_data => true
end
end
end
My post model looks like this
class Post < ApplicationRecord
translates :title,:body
validates :title, presence:true
validates :body, presence:true
end
What is exactly happening wrong ? I am exactly following the steps any help will be appreciated
New contributor
Krapi Rastogi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.