Create scopes:
class TodoItem < ActiveRecord::Base scope :complete, -> { where("completed_at is not null") } scope :incomplete, -> { where(completed_at: nil) } end
back to
Archived: This project has been archived. Cards can no longer be completed.
class TodoItem < ActiveRecord::Base scope :complete, -> { where("completed_at is not null") } scope :incomplete, -> { where(completed_at: nil) } end