module JamRuby class Feedback include ActiveModel::Validations include ActiveModel::Validations::Callbacks extend ActiveModel::Callbacks VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, format: {with: VALID_EMAIL_REGEX} validates :body, :presence => true attr_accessor :email, :body def save return valid? end end end