```ruby
class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers

  validates_presence_of :body
  validates_presence_of :title
end```

Add search class method for Question.
user
```ruby
class Question < ActiveRecord::Base
  belongs_to :user
  has_many :answers

  validates_presence_of :body
  validates_presence_of :title

  def self.search(words)
    matches = []
    words.split(' ').each do |word|
      matches << Question.all.map { |q| q.title.include?(word) || q.body.include?(word) }
    end
    matches
  end
end```
assistant