Closed vipulnsward closed 2 months ago
This update enhances the Uploadcare integration by introducing support for Mongoid models, which allows for efficient file and file group management within MongoDB-based Rails applications. The Gemfile has been organized to group test dependencies, and documentation has been improved to clarify compatibility with ActiveRecord, ActiveModel, and Mongoid. New modules have been created for handling Uploadcare files and file groups, increasing flexibility across various model types.
Files | Change Summary |
---|---|
CHANGELOG.md |
Added "Unreleased" section detailing Mongoid support for mount_uploadcare_file and mount_uploadcare_file_group . |
Gemfile |
Encapsulated test-related gems in a group :test block for better organization and added mongoid dependency. |
README.md |
Added note on Uploadcare support for ActiveRecord, ActiveModel, and Mongoid models. |
lib/uploadcare/rails/engine.rb |
Extended Uploadcare Rails engine to support Mongoid, requiring new files for Mongoid-specific functionality. |
lib/uploadcare/rails/mongoid/mount_uploadcare_file.rb |
Introduced MountUploadcareFile module for handling Uploadcare files in Mongoid models. |
lib/uploadcare/rails/mongoid/mount_uploadcare_file_group.rb |
Introduced MountUploadcareFileGroup module for managing file groups in Mongoid models. |
lib/uploadcare/rails/objects/concerns/loadable.rb |
Changed dependency from ActiveRecord to ActiveModel for attribute handling. |
spec/uploadcare/rails/mongoid/mount_uploadcare_file_group_spec.rb |
Added RSpec tests for MountUploadcareFileGroup functionality. |
spec/uploadcare/rails/mongoid/mount_uploadcare_file_spec.rb |
Added RSpec tests for MountUploadcareFile functionality. |
sequenceDiagram
participant User
participant MongoidModel
participant UploadcareAPI
User->>MongoidModel: Store a file
MongoidModel->>UploadcareAPI: Upload file
UploadcareAPI-->>MongoidModel: Return file metadata
MongoidModel-->>User: Confirm file stored
sequenceDiagram
participant User
participant MongoidModel
participant UploadcareAPI
User->>MongoidModel: Request file group
MongoidModel->>UploadcareAPI: Fetch file group data
UploadcareAPI-->>MongoidModel: Return file group info
MongoidModel-->>User: Display file group
Objective | Addressed | Explanation |
---|---|---|
Mongoid support | ✅ |
Description
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores