Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created October 19, 2014 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/ef1956a2d67ee75ff94d to your computer and use it in GitHub Desktop.
Save krainboltgreene/ef1956a2d67ee75ff94d to your computer and use it in GitHub Desktop.
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