class Document < ActiveRecord::Base
end

class Document < ActiveRecord::Base
  scope :full_text_search, -> (query) {
    where("MATCH(content) AGAINST(? IN BOOLEAN MODE)", "*D+ #{query}")
  }
end

Add a scope for full text search
Add a scope for full text search
