BathHacked/energy-sparks

View on GitHub
app/services/schools/contact_finder.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Schools
  class ContactFinder
    def initialize(school)
      @school = school
    end

    def contact_for(user)
      user.contacts.where(school: @school).last || Contact.where(school: @school).where(email_address: user.email).last
    end
  end
end