Created
October 19, 2014 18:00
-
-
Save krainboltgreene/ef1956a2d67ee75ff94d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Validation | |
class UniqueAccountEmail | |
def initialize(data:, model: Account::Model) | |
@data = data | |
@model = model | |
end | |
def valid? | |
@model.pluck("email").include?(@data) | |
end | |
def to_s | |
"email_is_unique" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment