From 447f55cc83f2c2ebd28657c83aa4bdd623ed0273 Mon Sep 17 00:00:00 2001 From: Lawrence Chou Date: Thu, 16 Sep 2021 23:22:26 +0800 Subject: [PATCH] Add mandatory 'stored' option to generated column example The current implementation (#41856) required `stored: true` to be passed when using `t.virtual()` https://github.com/rails/rails/pull/41856/files#diff-5b1b920fc3bebbb1d4c144b302603e5003a1d9e5a493e3234bf764b9e26fbe30R68-R75 --- guides/source/active_record_postgresql.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index c6d1ad6963..27e158186b 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -562,7 +562,7 @@ create_table :documents do |t| t.string :body t.virtual :textsearchable_index_col, - type: :tsvector, as: "to_tsvector('english', title || ' ' || body)" + type: :tsvector, as: "to_tsvector('english', title || ' ' || body)", stored: true end add_index :documents, :textsearchable_index_col, using: :gin, name: 'documents_idx'