ActiveRecordのscopeでnilを返すと… - Qiita

モデルのscopeを書くときclass User < ActiveRecord::Base scope :hoge, -> (fuga) { find_by(fuga: fuga) }endこ…