Sha256: be423a89b4cca2de6aaa645d8e42ec3fa7740d57d4a596006dda67272976a0ad
Contents?: true
Size: 509 Bytes
Versions: 30
Compression:
Stored size: 509 Bytes
Contents
module ClarkKent class UserReportEmail < ActiveRecord::Base belongs_to :user, class_name: ClarkKent.user_class_name belongs_to :report_email validates_with UserEmailValidator def email=(address) self.user = ClarkKent.user_class.where("lower(#{ClarkKent.user_class_name.underscore.pluralize}.email) = lower(:email)",email: address).first self.errors.add(:email, "Couldn't find a user with that email addres") unless self.user.present? end def email self.user.try :email end end end
Version data entries
30 entries across 30 versions & 1 rubygems