Conversation
Signed-off-by: Robert Smith <rob@bettertogethersolutions.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds the initial scaffold for Agreements and Agreement Terms in the BetterTogether engine, including models, migrations, controllers, views, routes, policies, and placeholder tests.
- Introduces
AgreementandAgreementTermmodels with associations, nested attributes, and translations. - Adds migrations and updates
spec/dummy/db/schema.rbandconfig/routes.rbto support the new tables and resource routes. - Scaffolds views (including Bootstrap markup), policies, empty factories, and pending RSpec examples for views, models, helpers, and requests.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| db/migrate/20250516130902_create_better_together_agreements.rb | Creates agreements table with bt_* helpers |
| db/migrate/20250516133320_create_better_together_agreement_terms.rb | Creates agreement_terms table with references |
| spec/views/better_together/agreements/show.html.erb_spec.rb | Adds pending view spec |
| spec/views/better_together/agreements/index.html.erb_spec.rb | Adds pending view spec |
| spec/requests/better_together/agreements_spec.rb | Adds basic request spec for index/show |
| spec/models/better_together/agreement_term_spec.rb | Adds pending model spec |
| spec/models/better_together/agreement_spec.rb | Adds pending model spec |
| spec/helpers/better_together/agreements_helper_spec.rb | Adds pending helper spec |
| spec/factories/better_together/agreements.rb | Defines empty agreement factory |
| spec/factories/better_together/agreement_terms.rb | Defines empty agreement_term factory |
| spec/dummy/db/schema.rb | Updates dummy database schema to include new tables |
| config/routes.rb | Adds resources :agreements under authenticated user |
| app/models/better_together/agreement.rb | Introduces Agreement model with nested terms |
| app/models/better_together/agreement_term.rb | Introduces AgreementTerm model |
| app/controllers/better_together/agreements_controller.rb | Sets up AgreementsController |
| app/views/better_together/agreements/_form.html.erb | Adds form partial with tabbed interface |
| app/views/better_together/agreements/index.html.erb | Adds index view table for agreements |
| app/views/better_together/agreements/show.html.erb | Adds show view for agreements |
| app/views/better_together/agreements/new.html.erb | Adds new agreement view |
| app/views/better_together/agreements/edit.html.erb | Adds edit agreement view |
| app/views/better_together/calendars/new.html.erb | Updates calendar new view styling |
| app/views/better_together/agreement_terms/_fields.html.erb | Defines nested fields partial |
| app/views/better_together/agreement_terms/_agreement_terms.html.erb | Defines dynamic fields UI |
| app/policies/better_together/agreement_policy.rb | Adds authorization policy for agreements |
| app/helpers/better_together/agreements_helper.rb | Adds empty helper module |
Comments suppressed due to low confidence (9)
spec/views/better_together/agreements/show.html.erb_spec.rb:4
- This spec is marked pending without any examples. Add at least one example to verify the rendered content or remove the spec if it’s not needed.
pending "add some examples to (or delete) #{__FILE__}"
spec/views/better_together/agreements/index.html.erb_spec.rb:4
- This spec is pending with no assertions. Provide examples to verify the index view or remove the placeholder.
pending "add some examples to (or delete) #{__FILE__}"
spec/requests/better_together/agreements_spec.rb:3
- The request spec only covers GET index and show. Consider adding tests for create, update, and destroy actions to ensure full coverage.
RSpec.describe "Agreements", type: :request do
spec/models/better_together/agreement_term_spec.rb:5
- Empty model spec—add validations and association tests for
AgreementTermor remove the spec if not needed.
pending "add some examples to (or delete) #{__FILE__}"
spec/models/better_together/agreement_spec.rb:5
- Empty model spec—add tests for validations, associations, and nested attributes on
Agreementor remove the placeholder.
pending "add some examples to (or delete) #{__FILE__}"
spec/helpers/better_together/agreements_helper_spec.rb:15
- Empty helper spec—either add examples to cover any helper methods or remove the file if it remains blank.
pending "add some examples to (or delete) #{__FILE__}"
spec/factories/better_together/agreements.rb:2
- Empty factory—define default attributes so
Agreementinstances created in tests are valid by default.
factory :agreement do
spec/factories/better_together/agreement_terms.rb:2
- Empty factory—add required attributes (e.g.,
identifier,position,agreementassociation) so test objects are valid.
factory :agreement_term do
config/routes.rb:36
- [nitpick] Indent this
resources :agreementsline consistently under theauthenticated :user doblock for readability.
resources :agreements
app/views/better_together/agreement_terms/_agreement_terms.html.erb
Outdated
Show resolved
Hide resolved
…l.erb Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Robert Smith <rob@bettertogethersolutions.com>
## Summary - Add `AgreementParticipant` to link people to agreements and extend agreement terms with summaries - Require acceptance of Terms of Service and Privacy Policy during registration and record consent - Seed default agreements (privacy policy & terms of service) with builder ## Testing - `bin/codex_style_guard` - `bundle exec rubocop` - `bundle exec brakeman -q -w2` - `bundle exec bundler-audit --update` - `bin/ci` *(fails: ActiveRecord::DatabaseConnectionError: could not connect to community-engine-db)* ------ https://chatgpt.com/codex/tasks/task_e_68923a04971883218ee3e203ba9cc4e0
…ith-participants-and-terms Signed-off-by: Robert Smith <rob@bettertogethersolutions.com>
## Summary - add AgreementParticipant model and associations for tracking who accepted each agreement - require privacy policy and terms-of-service consent during registration with accessible summaries - seed initial privacy and terms agreements for managers via AgreementBuilder ## Testing - `bin/ci` *(no examples found)* - `bundle exec rspec spec/models/better_together/agreement_participant_spec.rb spec/features/agreements/registration_consent_spec.rb --format documentation` - `bundle exec rubocop` - `bundle exec brakeman -q -w2` - `bundle exec bundler-audit --update` ------ https://chatgpt.com/codex/tasks/task_e_6892377c88c4832196740a9acbdfce2b
Signed-off-by: Robert Smith <rob@bettertogethersolutions.com>
…modal frame instead of causing a frame reload
…t before it will let them check the agreement box
…t the conditions for checking the box
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Robert Smith <rob@bettertogethersolutions.com>
Pull Request #884: Add Agreements and Agreement Terms
Overview
Key Highlights by File
app/builders/better_together/agreement_builder.rb
app/controllers/better_together/agreements_controller.rb
app/controllers/better_together/users/registrations_controller.rb
Styling & Layout
Helper Module
Summary
This PR lays the groundwork for a structured agreements system:
Next Steps / Considerations