From a45016f539215779a85d0ecbf691e890ab3339b5 Mon Sep 17 00:00:00 2001 From: Torsten Date: Mon, 30 Jan 2023 19:00:45 +0200 Subject: [PATCH] rename scope --- app/controllers/members_controller.rb | 2 +- app/models/member.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index d1f5a20..f050b4d 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -3,7 +3,7 @@ class MembersController < ApplicationController # GET /members def index - @members = Member.public.order(:name).page params[:page] + @members = Member.public_scope.order(:name).page params[:page] end # GET /members/1 diff --git a/app/models/member.rb b/app/models/member.rb index 1adc0cd..ec5b889 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -1,6 +1,6 @@ class Member < ApplicationRecord - def self.public + def self.public_scope where.not(confirmed_at: nil).where.not(picture: nil) end