app/models/georgia/message.rb in georgia-0.7.1 vs app/models/georgia/message.rb in georgia-0.7.2
- old
+ new
@@ -1,8 +1,10 @@
module Georgia
class Message < ActiveRecord::Base
+ include Georgia::Indexer
+
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
@@ -17,28 +19,9 @@
attr_accessor :permalink, :author_url
scope :spam, where(spam: true)
scope :ham, where(spam: false)
scope :latest, order("created_at DESC")
-
- # Search
- searchable do
- text :name
- text :email
- text :message
- text :subject
- text :phone
- string :spam do
- status
- end
- # For sorting:
- string :name
- string :email
- string :phone
- string :subject
- string :message
- time :created_at
- end
def status
@status ||= spam ? 'spam' : 'clean'
end
\ No newline at end of file