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