Commit Graph
17 Commits
Author SHA1 Message Date
Brenda Wallace 977a984c24 Remove Elasticsearch integration and related code
- Deleted Elasticsearch gems from Gemfile and Gemfile.lock.
- Updated README and TECH documentation to reflect the removal of Elasticsearch.
- Removed Elasticsearch-related code from models, controllers, services, and factories.
- Adjusted tests to eliminate dependencies on Elasticsearch.
- Cleaned up Docker configuration and environment variables related to Elasticsearch.
- Added a TODO file for future gem reviews and potential removals.
2026-10-22 15:37:03 +13:00
7160f50ac1 Refactor Activity model to remove Elasticsearch integration (#4576)
* Refactor Activity model to remove Elasticsearch integration

- Removed `SearchActivities` concern and Searchkick from `Activity` model.
- Implemented `Activity.homepage_records` using ActiveRecord with `DISTINCT ON` for PostgreSQL.
- Updated `ActivitiesController#index` to use ActiveRecord queries with eager loading and pagination.
- Added `active` scope to `Activity`.
- Added unit tests for `Activity` model.
- Deleted `app/models/concerns/search_activities.rb`.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Fix NoMethodError: undefined method 'reindex' for class Activity

- Removed all calls to `Activity.reindex` in migrations, rake tasks, and spec helpers.
- These were causing failures after the removal of Searchkick from the Activity model.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Fix ambiguous column id in homepage_records query

- Updated `Activity.homepage_records` to use `activities.id` instead of `id` in the subquery.
- This resolves the `PG::AmbiguousColumn: ERROR: column reference "id" is ambiguous` error.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Fix ambiguous created_at in homepage_records query

- Use `unscoped` in the subquery for `Activity.homepage_records` to bypass the default scope from `Ownable` concern.
- This prevents the join with the `members` table in the subquery, which was causing `PG::AmbiguousColumn: ERROR: column reference "created_at" is ambiguous`.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Complete refactoring of Activity model to remove Elasticsearch

- Removed SearchActivities concern and searchkick integration.
- Updated ActivitiesController#index to use ActiveRecord queries.
- Implemented performant Activity.homepage_records using DISTINCT ON (PostgreSQL).
- Added Activity.active scope.
- Added no-op Activity.reindex (class and instance methods) for backward compatibility.
- Cleaned up leftover reindex calls in rake tasks, migrations, and spec helpers.
- Added unit tests for new Activity model logic.
- Updated factories to include no-op reindex traits.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Less eager loading

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-04-28 17:51:01 +09:30
Brenda 7257b2ada1 Update with frozen literals 2020-01-10 16:50:52 +13:00
Brenda Wallace f019969240 Tidy up posts 2019-05-18 21:41:41 +12:00
Brenda Wallace b8fae99bde Times with zone, in factories 2018-12-30 15:34:24 +13:00
Awesome Code 90f4db4853 Auto corrected by following Ruby rspec layout 2018-09-10 22:20:12 +00:00
Awesome Code 31744491ea Auto corrected by following Ruby FactoryBot/AttributeDefinedStatically 2018-09-09 21:53:57 +00:00
Brenda Wallace 65b4c7dbc1 Revert "Auto corrected by following Style/StringLiterals"
This reverts commit ab56a3c6b3.
2018-02-09 07:58:47 +13:00
Awesome Code ab56a3c6b3 Auto corrected by following Style/StringLiterals 2018-02-07 10:20:26 +13:00
Awesome Code 8d166f1fe6 Auto corrected by following FactoryBot/DynamicAttributeDefinedStatically 2018-01-23 09:00:34 +13:00
Logan Gingerich 10a8df47a9 Factorygirl to factorybot - fixes #1413 (#1425)
* FactoryGirl Changed to FactoryBot

file fix

changes based on comments received

Bundle Update on 2017-10-29

style update to align hash literal

added package-lock

* indentation fixes with rubocop

* name added to contributors
2017-11-01 15:03:31 +00:00
Brenda Wallace 62e7c716dd Removed extra empty blank lines 2016-11-26 12:06:02 +13:00
gnattery de85a6dcce added associations between forums, posts, and members 2013-02-13 15:17:40 +11:00
Skud df76f2497a renamed Post.member_id to Post.author 2013-01-13 20:57:28 +11:00
Skud 657ccf7cd8 s/users/members/g -- models and tests for them 2013-01-13 17:24:46 +11:00
Skud 801a3d0f6c Added some basic tests for RSS feeds. 2013-01-13 17:06:36 +11:00
Skud 21f0f39bf9 Model and controller spec files pass.
Views are another matter (and will explode badly at this point)
2013-01-13 16:12:45 +11:00