Sha256: dd1ab753841906aea91085458e725a4a13dc2bdef7e9e5770323d3e83ce56c06
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
module GeorgiaMailer class Message < ActiveRecord::Base attr_accessible :name, :email, :subject, :message, :attachment, :phone delegate :url, :current_path, :size, :content_type, :filename, to: :attachment validates :name, presence: true validates :email, format: /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i validates :message, presence: true mount_uploader :attachment, Georgia::AttachmentUploader # Anti Spam: check https://github.com/joshfrench/rakismet for more details include Rakismet::Model rakismet_attrs author: :name, author_email: :email, content: :message, comment_type: 'message' attr_accessible :user_ip, :user_agent, :referrer, :spam, :verified_at attr_accessor :permalink, :author_url scope :spam, where(spam: true) scope :ham, where(spam: false) scope :latest, order("created_at DESC") def status @status ||= spam ? 'spam' : 'clean' end include Georgia::Indexer::Adapter is_searchable({ solr: GeorgiaMailer::Concerns::SolrGeorgiaMailerMessageExtension, tire: GeorgiaMailer::Concerns::TireGeorgiaMailerMessageExtension }) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
georgia_mailer-0.1.0 | app/models/georgia_mailer/message.rb |