Skip to content

Commit

Permalink
Merge pull request #60 from sascha-karnatz/searchable-created-at-publ…
Browse files Browse the repository at this point in the history
…ic-on

Use public_on instead of published_at for pg_search_documents
  • Loading branch information
tvdeyen authored Nov 7, 2024
2 parents 98942ef + 7caf5ba commit bc98f48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/extensions/alchemy/pg_search/page_extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.prepended(base)
:meta_keywords,
:name,
],
additional_attributes: ->(page) { { page_id: page.id, searchable_created_at: page.published_at } },
additional_attributes: ->(page) { { page_id: page.id, searchable_created_at: page.public_on } },
if: :searchable?,
)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
end

it "stores searchable created_at" do
expect(page.pg_search_document.searchable_created_at).to eq(page.published_at)
expect(page.pg_search_document.searchable_created_at).to eq(page.public_on)
end
end
end

0 comments on commit bc98f48

Please sign in to comment.