mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-03 15:07:48 -05:00
* feat: Add version tracking to Crop model This commit introduces version tracking for the Crop model using the PaperTrail gem. Key changes include: - Integrating `has_paper_trail` into the `Crop` model. - Adding a "History" section to the crop show page to display a timeline of changes for that specific crop. - Creating a new admin page for users with the "crop_wrangler" role to view a log of all recent crop edits, creations, and deletions. - Fixing several N+1 query performance issues by eager-loading associated `Member` records in both the `CropsController` and the new `Admin::CropsController`. - Refactoring view logic into a shared partial to reduce code duplication. * Add papertrail * Admin UI * Add papertrail DB * Add papertrail DB * Rearrange * Fix permissions * Fix permissions * Fix UI * Fix UI --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
18 lines
470 B
Plaintext
18 lines
470 B
Plaintext
- if version.changeset.present?
|
|
.changes
|
|
- version.changeset.each do |field, changes|
|
|
- if field != "updated_at"
|
|
.row
|
|
.col-md-3
|
|
%strong= field.humanize
|
|
.col-md-9
|
|
- if changes[0].present?
|
|
%em= changes[0]
|
|
- else
|
|
%em (blank)
|
|
%span.text-muted ->
|
|
- if changes[1].present?
|
|
%em= changes[1]
|
|
- else
|
|
%em (blank)
|