Commit Graph

387 Commits

Author SHA1 Message Date
google-labs-jules[bot]
f2421bf4c7 Here's the plan to add polymorphic comments and update related functionality:
This change introduces polymorphic comments, allowing you to comment on Photos, Plantings, Harvests, and Activities, in addition to Posts.

Key changes include:

-   **Comment Model:**
    -   Made `Comment.commentable` a polymorphic association.
    -   Added a data migration to move existing post comments to the new structure.
    -   Updated notification creation logic for polymorphic commentables.
-   **CommentsController:**
    -   Refactored to handle various commentable types using a `find_commentable` method.
-   **Ability Model:**
    -   Updated permissions for comment creation, editing (author/admin), and deletion (author/commentable owner/admin).
-   **Routes:**
    -   Added nested comment routes for Photos, Plantings, Harvests, Activities, and Posts using a `commentable` concern with shallow routes.
-   **Views:**
    -   Created generic partials for comment forms (`_form.html.haml`) and display (`_comment.html.haml`, `_comments.html.haml`).
    -   Integrated these partials into the show pages of all commentable types.
    -   Updated `comments/new` and `comments/edit` views to be generic.
    -   Relevant parent controller `show` actions now eager-load comments.
-   **Testing:**
    -   Added extensive model, controller (using shared examples), and feature tests to cover the new polymorphic comment functionality, including permissions and UI interactions for all commentable types.
    -   Updated and created factories as needed.

This fulfills the issue requirements for adding comments to multiple resource types with appropriate permissions.
2025-05-25 02:03:17 +00:00
Daniel O'Connor
81060cccf7 Ruby 3.2: Rubocop - Lint/* and Style/* (#3786)
* Rubocop - Layout/*
* Rubocop - Lint and Style
2024-07-13 15:38:37 +09:30
Daniel O'Connor
e69467f056 Ruby 3.2: Rubocop - RSpec/excessive docstring spacing (#3782)
* RSpec/ExcessiveDocstringSpacing
2024-07-13 15:12:56 +09:30
Daniel O'Connor
d1f754a288 Rubocop 2022-11-08 00:23:38 +10:30
Daniel O'Connor
2db3d1bacc Various corrections 2022-11-08 00:21:23 +10:30
Daniel O'Connor
e2942f17c7 Rubocop corrections 2022-11-08 00:18:35 +10:30
Daniel O'Connor
b24b9f82e6 Rubocop - auto corrections 2022-11-06 16:34:36 +10:30
Brenda Wallace
43a577fa50 Update rubocop config 2021-01-05 19:46:07 +13:00
Brenda Wallace
0108224e4e Tests for crop creation 2020-08-26 12:36:58 +12:00
Brenda Wallace
8016a35e49 Adding contributor check to github actions 2020-08-26 12:36:58 +12:00
Brenda Wallace
bcc722d0c2 Updating content type in tests to include charset 2020-08-26 12:36:58 +12:00
Brenda Wallace
f1d830bfa9 fixed ambiguous negative 2020-08-26 12:36:58 +12:00
codefactor-io
4ff95fbac9 [CodeFactor] Apply fixes 2020-01-21 22:26:08 +13:00
codefactor-io
6c9a15f95e [CodeFactor] Apply fixes 2020-01-11 21:29:37 +00:00
Brenda Wallace
8dfb8ff954 Update params in seeds controller spec 2020-01-08 08:10:16 +13:00
Brenda Wallace
8a6c4a774a reindexs photo in photo controller spec 2020-01-06 21:53:02 +13:00
codefactor-io
7e30b6b6e0 [CodeFactor] Apply fixes 2020-01-03 11:28:51 +00:00
Brenda Wallace
b556c4b8f4 Merge branch 'dev' into cache/harvests 2020-01-02 15:42:17 +13:00
Martina Simicic
9eb5fe7947 Use specific error for raise_error expectation 2020-01-02 14:18:51 +13:00
Brenda Wallace
76e649a0a8 update likes controller spec for new params 2020-01-01 09:26:54 +13:00
Brenda Wallace
f76266a716 photos controller working with ES 2019-12-31 21:46:42 +13:00
Brenda Wallace
8ee332edd8 update harvests controller 2019-12-28 09:20:18 +13:00
Brenda Wallace
ce909332b7 plantings controller update 2019-12-28 09:15:52 +13:00
codefactor-io
1bb8770a6e [CodeFactor] Apply fixes 2019-12-27 06:51:32 +00:00
Brenda Wallace
75ed36d16c Merge branch 'cache/harvests' of github.com:Br3nda/growstuff into cache/harvests 2019-12-27 19:50:52 +13:00
Brenda Wallace
a015110b05 Reindex before running plantings controller specs 2019-12-27 19:50:46 +13:00
codefactor-io
2685cc70a7 [CodeFactor] Apply fixes to commit 1c7816c 2019-12-27 04:21:06 +00:00
Brenda Wallace
1c7816c951 fixing photos by crop query in photos controller 2019-12-27 17:20:28 +13:00
Brenda
42e225469a Routes using slugs (instead of ids)
this seems to be intended by the models having slugs (added about 7 years ago) but the routes weren't using them
2019-12-26 23:30:23 +00:00
Brenda Wallace
0d08f48b71 turn on ES indexing in some controllers 2019-12-27 09:15:53 +13:00
Brenda
bdee705b55 Update with frozen literals 2019-12-26 13:38:17 +13:00
Brenda Wallace
b8c94c13cc refactor to use search:true instead of reindex 2019-12-24 22:15:01 +13:00
codefactor-io
df97d51940 [CodeFactor] Apply fixes 2019-12-23 22:39:08 +00:00
Brenda Wallace
4a2bb2342c Sorting out cancancan, copied to common parent controller 2019-12-24 11:38:30 +13:00
Brenda Wallace
f8abcd4d1c gardens controller spec using slug 2019-12-23 15:08:10 +13:00
codefactor-io
75c7d63956 [CodeFactor] Apply fixes to commit b730378 2019-12-22 20:46:08 +00:00
Brenda Wallace
b730378e14 tidy up and fix specs for harvest controller 2019-12-23 09:45:35 +13:00
Brenda Wallace
4cf5daf3b8 gardens charts controller using slug 2019-12-23 09:44:06 +13:00
codefactor-io
81051c6865 [CodeFactor] Apply fixes to commit 5a6ee38 2019-12-22 03:58:03 +00:00
Brenda Wallace
5a6ee38722 update plantings controller spec to look for a hash of searchkick results 2019-12-22 16:57:28 +13:00
codefactor-io
e8760f9c38 [CodeFactor] Apply fixes 2019-12-20 03:33:23 +00:00
Brenda Wallace
04fd1a343a Rubocop update (#2334)
* Update rubocop config

* Rubocop update - for rubocop 0.77

* [CodeFactor] Apply fixes

* rubocop fixes

* [CodeFactor] Apply fixes to commit 2826c2e
2019-12-16 22:35:33 +13:00
Brenda Wallace
7c38f7eca6 Pull homepage data directly from elasticsearch (#2316)
* Pull homepage data directly from elasticsearch

* Removing non-elasticsearch options

* [CodeFactor] Apply fixes to commit c46b2e7
2019-12-09 10:03:48 +13:00
Brenda Wallace
140f625c48 Add new planting api attributes to test 2019-11-16 22:40:06 +13:00
Brenda Wallace
4c82adc612 Added new api items to controller spec 2019-11-16 20:38:15 +13:00
Brenda Wallace
dc3a730064 update spec to use expect syntax 2019-10-24 16:15:06 +13:00
Brenda Wallace
5a6d0f6342 Check admin before roles controller runs 2019-10-19 10:22:27 +13:00
Brenda Wallace
2ddddb1652 Updated specs for admin editing roles 2019-10-19 10:16:02 +13:00
Brenda Wallace
f297fdc677 Inline editing and display tidy ups 2019-10-05 20:58:00 +13:00
Brenda Wallace
b7321ed46f Add source to photos 2019-09-20 22:26:39 +12:00