pg_search

https://github.com/casecommons/pg_search

Ruby

pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL’s full text search

Discussion.override_discussion_id

When notes on a commit are displayed in context of a merge request that contains that commit,
these notes are to be displayed as if they were part of one discussion, even though they were actually
individual notes on the commit with different discussion IDs, so that it's clear that these are not
notes on the merge request itself.

To turn a list of notes into a list of discussions, they are grouped by discussion ID, so to
get these out-of-context notes to end up in the same discussion, we need to get them to return the same
`discussion_id` when this grouping happens. To enable this, `Note#discussion_id` calls out
to the `override_discussion_id` method on the appropriate `Discussion` subclass, as determined by
the `discussion_class` method on `Note` or a subclass of `Note`.

If no override is necessary, return `nil`.
For the case described above, see `OutOfContextDiscussion.override_discussion_id`.

Source | Google | Stack overflow

Edit

git clone [email protected]:casecommons/pg_search.git

cd pg_search

open

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Discussion-override_discussion_id-for-pr


# Commit to git

git add git commit -m "better docs for Discussion.override_discussion_id"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Discussion-override_discussion_id-for-pr

hub pull-request


# Celebrate!