Add active/inactive status to properties #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "9-property-active-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
activeboolean to properties (default true) for property lifecycle managementChanges
db/migrate/20260525030000_add_active_to_properties.rb: addactiveboolean (default: true, null: false)app/models/property.rb: addscope :activeapp/controllers/work_queue_items_controller.rb: filter@propertiestoProperty.activespec/models/property_spec.rb: 2 new specs for active scopespec/requests/work_queue_items_spec.rb: 1 new spec verifying inactive exclusionTest Plan
Review Checklist
Related Notes
project-landscaping-assistantPR #12 Review
DOMAIN REVIEW
Tech stack: Ruby on Rails 8.1, PostgreSQL, RSpec, Hotwire/Turbo
Migration (
db/migrate/20260525030000_add_active_to_properties.rb):default: true, null: false-- existing rows get backfilled totrueautomatically by PostgreSQL forADD COLUMN ... DEFAULT.remove_columnautomatically sincechangemethod is used.Model scope (
app/models/property.rb):scope :active, -> { where(active: true) }is clean and correct.Controller filtering (
app/controllers/work_queue_items_controller.rb):Property.active.includes(...)correctly chains the scope before eager loading.indexaction (the "All Properties" sidebar) is filtered -- appropriate for this ticket's scope.Test coverage (
spec/models/property_spec.rb,spec/requests/work_queue_items_spec.rb):active: trueinclusion and default-value inclusion -- good./todayresponse body.let!(:property)which defaults to active, verifying it still appears -- good contrast test.BLOCKERS
None. All blocker criteria pass:
NITS
Missing
db/schema.rbupdate in the diff: The schema file onmainstill showsversion: 2026_05_25_020000without theactivecolumn. The PR diff does not include aschema.rbchange. This means either: (a) the migration has not been run locally before committing, or (b) the schema version coincidentally matches. Given the migration timestamp is20260525030000which is newer than the current schema version2026_05_25_020000, theschema.rbshould have been regenerated. Verifybin/rails db:migratewas run andschema.rbcommitted. This is not a blocker since CI will catch it, but it could cause merge issues.Scope naming convention: Consider adding an
inactivescope as well (scope :inactive, -> { where(active: false) }) for future admin views that need to list deactivated properties. Not required for this PR but worth noting for the properties tab work in #10.No index on
activecolumn: For a small dataset this is fine, but if the property count grows, a partial index onactive = trueor a simple index onactivewould help the.activescope. Not needed now.SOP COMPLIANCE
9-property-active-statusfollows{issue-number}-{kebab-case-purpose}project-landscaping-assistantreferencedPROCESS OBSERVATIONS
schema.rbomission (nit #1) should be verified before merge to avoid CI failures or a brokendb:schema:loadpath for fresh environments.VERDICT: APPROVED