我有属于该项目的会议模型:
class Project < ActiveRecord::Base
has_many :meetings
end
class Meeting < ActiveRecord::Base
belongs_to :project
define_index do
join project
indexes agenda
indexes project.name. :as => :project_name
end
end
我尝试使用分组进行搜索:
Meeting.search("stuff", :group_by => 'project_id', :group_function => :attr)
我收到以下错误:
group-by attribute 'project_id' not found
有什么建议么?
非常感谢。