- # Filter by a given string
- if params[:q]
- @notes = @notes.joins(:comments)
- @notes = if @user
- @notes.where("to_tsvector('english', comments_notes.body) @@ plainto_tsquery('english', ?)", params[:q])
- else
- @notes.where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q])
- end
+ raise OSM::APIBadUserInput, "User #{params[:user]} not known" unless @user
+ end
+
+ @notes = @notes.joins(:comments).where(:note_comments => { :author_id => @user })