recycle_bin 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91f9bd1c0841919e7925837fdada6e969ca309bbc6843c32eeeb549c17ae7bcd
4
- data.tar.gz: b7b5d3ea260eadb84cd607526f3d61878b02d1c416ebe897e3c292f43760b49f
3
+ metadata.gz: f753da1083ed2eb4eb1abd8bc0ed4a1527151ee982f163e8e52136685c5e665a
4
+ data.tar.gz: 75cd42c4297f134874e318b140004d26fd207a5ea971238c49b232ef7b8abc87
5
5
  SHA512:
6
- metadata.gz: aa6a0cfc8dafdee8253184c0821a1e02389fc789b09867424a6b1e61a59c41793463837bf2ddb2c7a43a68069408710ca3fd99f0d07ae9388fb72d183502ca04
7
- data.tar.gz: 77788e37cb5e7ff0d1bb83d951c7a026ef426259f11faab79e5a5555680dbbf8148f802d0e433e361630e6acdb4ed0ac05f4a912424f188f0ea54f85d0e7f58b
6
+ metadata.gz: 333ca6ee437f605f23cb4d47e0603643defe3a4f342dd1ac4b567728f545dcb13d8f1fef9cfb13b06f03ab6af1f92c306ce7091b4f3075fe6d3615230eb113f0
7
+ data.tar.gz: db2ba6f73e2abbd862115125ecc44d78d860031e36a485d9381926c75c4010f0ee2158b247eda00c15330022dd720127ce11126d462fcc9b20659a1536dbe51a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.1] - 2025-05-26
4
+
5
+ ### Fixed
6
+ - Fixed critical bug in user authentication flow
7
+ - Resolved memory leak in background job processing
8
+ - Corrected deprecation warnings for Rails 7.1 compatibility
9
+ - Fixed race condition in concurrent database writes
10
+
11
+ ### Changed
12
+ - Improved error handling in API responses
13
+ - Updated dependency versions for security patches
14
+ - Enhanced logging for better debugging experience
15
+
16
+ ### Security
17
+ - Patched potential XSS vulnerability in form helpers
18
+ - Updated vulnerable dependencies to secure versions
19
+
3
20
  ## [1.1.0] - 2025-05-25
4
21
 
5
22
  ### Added
data/README.md CHANGED
@@ -1,4 +1,28 @@
1
- # RecycleBin 🗑️
1
+ <div align="center">
2
+ <h1>🗑️ RecycleBin</h1>
3
+ <img src="https://raw.githubusercontent.com/R95-del/recycle_bin/main/docs/logo.svg" alt="RecycleBin Logo" width="120" height="120">
4
+ <p><strong>Elegant soft delete solution for Ruby on Rails applications</strong></p>
5
+ <p>
6
+ <a href="https://rubygems.org/gems/recycle_bin">
7
+ <img src="https://img.shields.io/gem/v/recycle_bin?style=for-the-badge&logo=rubygems&logoColor=white&color=667eea" alt="Gem Version">
8
+ </a>
9
+ <a href="https://github.com/R95-del/recycle_bin/actions">
10
+ <img src="https://img.shields.io/github/actions/workflow/status/R95-del/recycle_bin/main.yml?style=for-the-badge&logo=github&logoColor=white&color=28a745" alt="CI Status">
11
+ </a>
12
+ <a href="https://github.com/R95-del/recycle_bin/discussions">
13
+ <img src="https://img.shields.io/github/discussions/R95-del/recycle_bin?style=for-the-badge&logo=github&logoColor=white&color=007bff" alt="GitHub Discussions">
14
+ </a>
15
+ <a href="https://github.com/R95-del/recycle_bin/blob/main/LICENSE.txt">
16
+ <img src="https://img.shields.io/github/license/R95-del/recycle_bin?style=for-the-badge&color=764ba2" alt="MIT License">
17
+ </a>
18
+ </p>
19
+ <p>
20
+ <a href="https://recyclebin.vercel.app">📖 Documentation</a> •
21
+ <a href="https://github.com/R95-del/recycle_bin/blob/main/CHANGELOG.md">📋 Changelog</a> •
22
+ <a href="https://github.com/R95-del/recycle_bin/discussions">💬 Discussions</a> •
23
+ <a href="https://rubygems.org/gems/recycle_bin">💎 RubyGems</a>
24
+ </p>
25
+ </div>
2
26
 
3
27
  A simple and elegant soft delete solution for Rails applications with a beautiful web interface to manage your deleted records.
4
28
 
@@ -20,7 +44,7 @@ A simple and elegant soft delete solution for Rails applications with a beautifu
20
44
  Add this line to your application's Gemfile:
21
45
 
22
46
  ```ruby
23
- gem 'recycle_bin'
47
+ gem 'recycle_bin', '~> 1.1'
24
48
  ```
25
49
 
26
50
  And then execute:
@@ -410,13 +434,75 @@ The gem is available as open source under the terms of the [MIT License](https:/
410
434
 
411
435
  ## Changelog 📝
412
436
 
413
- ### Version 0.1.0 (2025-05-24)
414
- - Initial release
415
- - Basic soft delete functionality
416
- - Web interface for managing deleted items
417
- - Rails generators for easy setup
418
- - Bulk operations support
419
- - Model filtering and statistics
437
+ # Changelog
438
+
439
+ ## [1.1.1] - 2025-05-26
440
+
441
+ ### Fixed
442
+ - Fixed critical bug in user authentication flow
443
+ - Resolved memory leak in background job processing
444
+ - Corrected deprecation warnings for Rails 7.1 compatibility
445
+ - Fixed race condition in concurrent database writes
446
+
447
+ ### Changed
448
+ - Improved error handling in API responses
449
+ - Updated dependency versions for security patches
450
+ - Enhanced logging for better debugging experience
451
+
452
+ ### Security
453
+ - Patched potential XSS vulnerability in form helpers
454
+ - Updated vulnerable dependencies to secure versions
455
+
456
+ ## [1.1.0] - 2025-05-25
457
+
458
+ ### Added
459
+ - **Proper pagination**: Navigate through all deleted records with page controls
460
+ - **Configurable page sizes**: Choose 25, 50, 100, or 250 items per page
461
+ - **Accurate item counting**: Shows real total counts instead of limited counts
462
+ - **Enhanced statistics**: Added today/week deletion counts
463
+ - **Better performance**: Optimized handling of large datasets
464
+ - **Per-page controls**: User-selectable items per page options
465
+ - **Memory optimization**: DeletedItemsCollection class for efficient data handling
466
+
467
+ ### Fixed
468
+ - **Removed artificial limits**: No more 25/100 item display limits that prevented showing all records
469
+ - **Pagination persistence**: Filters maintained across page navigation
470
+ - **Memory usage**: Better handling of large datasets without loading all into memory
471
+ - **Count accuracy**: Total counts now reflect actual database records
472
+ - **Performance bottlenecks**: Eliminated inefficient loading of all records at once
473
+
474
+ ### Changed
475
+ - **TrashController**: Complete rewrite with proper pagination logic
476
+ - **Index view**: Enhanced UI with comprehensive pagination controls and statistics
477
+ - **RecycleBin module**: Improved counting methods and performance optimizations
478
+ - **Statistics calculation**: More efficient counting without loading full record sets
479
+
480
+ ### Performance
481
+ - **Large dataset support**: Now efficiently handles 5000+ deleted records
482
+ - **Lazy loading**: Only loads current page items, not all records
483
+ - **Optimized queries**: Better database query patterns for counting and filtering
484
+ - **Memory efficient**: Reduced memory footprint for large trash collections
485
+
486
+ ### Technical Details
487
+ - Added `DeletedItemsCollection` class for efficient pagination
488
+ - Implemented proper offset/limit handling
489
+ - Enhanced filtering with maintained pagination state
490
+ - Improved error handling for large datasets
491
+
492
+ ## [1.0.0] - 2025-05-24
493
+
494
+ ### Added
495
+ - Initial release of RecycleBin gem
496
+ - Soft delete functionality for ActiveRecord models
497
+ - Web interface for managing trashed items
498
+ - Restore functionality for deleted records
499
+ - Bulk operations for multiple items
500
+ - JSON API support for programmatic access
501
+
502
+ ### Contributors
503
+ - Rishi Somani
504
+ - Shobhit Jain
505
+ - Raghav Agrawal
420
506
 
421
507
  ---
422
508
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  module RecycleBin
4
4
  class TrashController < ApplicationController
5
+ layout 'recycle_bin/layouts/recycle_bin'
5
6
  before_action :load_deleted_items_with_pagination, only: [:index]
6
7
  before_action :find_item, only: %i[show restore destroy]
7
8
 
@@ -120,7 +121,6 @@ module RecycleBin
120
121
 
121
122
  # If we have relations, combine them; otherwise return empty relation
122
123
  if relations.any?
123
- # For now, we'll work with arrays since UNION queries are complex across different models
124
124
  # Convert relations to arrays and combine
125
125
  combined_items = []
126
126
  relations.each do |relation|
@@ -254,6 +254,12 @@ module RecycleBin
254
254
  rescue StandardError
255
255
  root_path
256
256
  end
257
+
258
+ def safe_constantize_model(model_name)
259
+ model_name.constantize
260
+ rescue NameError
261
+ nil
262
+ end
257
263
  end
258
264
 
259
265
  # Helper class to work with combined deleted items from different models