-
Notifications
You must be signed in to change notification settings - Fork 19
Ruby Prepend
Prepend is a method that is baked into ruby. Prepend allows additional functionality to be added to methods that already exists in Caseflow without having to alter the original method definition. The benefit of this is that all tracked statuses can be housed in one singular directory rather than altering already existing method definitions directly within their original file.
A good example of how this works can be seen while looking at the method docket_appeal. This method is defined within app/models/pre_docket_task.rb. Rather than changing the method definition directly within the class so that it will now notify the appellant using the Appellant Notification Module, we can simply add that functionality to it outside of the pre_docket_task class by using prepend. All it takes to do this is adding a prepend statement at the top of the pre_docket_task class. In this instance, that would look like prepend AppealDocketed. The AppealDocketed module that is being prepended houses the updated functionality of the original docket_appeal method that is defined in the pre_docket_task class. This method will have super in it so that it inherits the original functionality as well as our notification method AppellantNotification.notify_appellant(appeal, @@template_name). This allows aspects of Appellant Notification to easily be altered in one directory rather than having to hunt down the notification methods all throughout Caseflow.
- Home
- Acronyms and Glossary
- Caseflow products
- Caseflow Intake
- Caseflow Queue
- Appeals Consumer
- Caseflow Reader
- Caseflow eFolder
- Caseflow Hearings
- Caseflow Certification
- Caseflow APIs
- Appeal Status API
- Caseflow Dispatch
-
CSUM Roles
- System Admin
- VHA Team Management
- Active Record Queries Resource
- External Integrations
- Caseflow Demo
- Caseflow ProdTest
- Background
- Stuck Jobs
- VA Notify
- Caseflow-Team
- Frontend Best Practices
- Accessibility
- How-To
- Debugging Tips
- Adding a Feature Flag with FeatureToggle
- Editing AMA issues
- Editing a decision review
- Fixing task trees
- Investigating and diagnosing issues
- Data and Metric Request Workflow
- Exporting and Importing Appeals
- Explain page for Appeals
- Record associations and Foreign Keys
- Upgrading Ruby
- Stuck Appeals
- Testing Action Mailer Messages Locally
- Re-running Seed Files
- Rake Generator for Legacy Appeals
- Manually running Scheduled Jobs
- System Admin UI
- Caseflow Makefile
- Upgrading Postgresql from v11.7 to v14.8 Locally
- VACOLS VM Trigger Fix M1
- Using SlackService to Send a Job Alert
- Technical Talks