Repository navigation
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR creates the initial MVP release (v0.0.1) of the EnumFields gem, which provides enhanced enum-like functionality for ActiveRecord models with support for metadata properties such as labels, icons, colors, and tooltips.
Key Changes
- Core enum field functionality with hash and array definition formats
- Automatic generation of class methods, instance methods, scopes, validations, and inquiry methods
- Custom column mapping support to separate accessor names from database column names
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/enum_fields.rb | Main module with concern integration and public API for defining enum fields |
| lib/enum_fields/definition.rb | Definition class handling validation and normalization of enum definitions |
| lib/enum_fields/enum_field.rb | Core EnumField class that generates all methods, scopes, and validations |
| lib/enum_fields/errors.rb | Custom error classes for missing and invalid definitions |
| spec/support/mock_active_record.rb | Mock ActiveRecord base class for testing without database |
| spec/support/shared_contexts.rb | Shared RSpec contexts for test model setup |
| spec/support/test_model_helper.rb | Helper module for creating test models dynamically |
| spec/spec_helper.rb | RSpec configuration with Pathname requirement |
| spec/enum_fields/*.spec.rb | Comprehensive test coverage for hash definitions, array definitions, column overrides, error handling, additional properties, and version |
| enum_fields.gemspec | Gem specification with dependencies on ActiveRecord/ActiveSupport 6.0-9.0 and Ruby >= 2.7.6 |
| Gemfile | Development dependencies including RSpec 3.13 and Rubocop 1.70 |
| README.md | Comprehensive documentation with usage examples and API reference |
| CHANGELOG.md | Initial release changelog for v0.0.1 |
| .rubocop.yml | Rubocop configuration targeting Ruby 2.7 |
| .rspec | RSpec configuration with Fuubar formatter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR serves to create the MVP for release.