9e8b89be1c
old mysql doesn't support 'cast(1 as integer)', but new/mariadb does postgres doesn't support 'cast(1 as signed)' should fix #145
15 lines
415 B
Ruby
15 lines
415 B
Ruby
ThinkingSphinx::Index.define :comment, :with => :active_record do
|
|
indexes comment
|
|
indexes short_id
|
|
indexes user.username, :as => :author
|
|
|
|
has "(CAST(upvotes as #{Story.votes_cast_type}) - " <<
|
|
"CAST(downvotes as #{Story.votes_cast_type}))", :as => :score,
|
|
:type => :bigint, :sortable => true
|
|
|
|
has is_deleted
|
|
has created_at
|
|
|
|
where sanitize_sql(:is_deleted => false, :is_moderated => false)
|
|
end
|