Skip to content

Instantly share code, notes, and snippets.

View Jeiwan's full-sized avatar
🛠️
Write code, delete code, repeat

Ivan Kuznetsov Jeiwan

🛠️
Write code, delete code, repeat
View GitHub Profile
ThinkingSphinx::Index.define :question, with: :active_record, delta: true do
#fields
indexes title, sortable: true
indexes body
indexes user.username, as: :author, sortable: true
#attributes
has created_at, updated_at, votes_sum
end
class Question < ActiveRecord::Base
include Votable
default_scope { order(created_at: :desc) }
belongs_to :user
has_many :answers, dependent: :destroy
has_many :attachments, as: :attachable, dependent: :destroy
has_many :comments, as: :commentable, dependent: :destroy
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
-- Control frame information -----------------------------------------------
c:0025 p:-17578920525412 s:0096 e:000095 TOP [FINISH]