diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 18e6d50..f853792 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -265,7 +265,7 @@ class CmsController < MyProfileController def search query = params[:q] - results = query.blank? ? [] : profile.articles.published.find_by_contents(query) + results = query.blank? ? [] : profile.files.published.find_by_contents(query) render :text => article_list_to_json(results), :content_type => 'application/json' end def media_upload diff --git a/app/models/profile.rb b/app/models/profile.rb index ac5591d..3c229ab 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -164,6 +164,8 @@ class Profile < ActiveRecord::Base has_many :articles, :dependent => :destroy belongs_to :home_page, :class_name => Article.name, :foreign_key => 'home_page_id' + has_many :files, :class_name => 'UploadedFile' + acts_as_having_image has_many :tasks, :dependent => :destroy, :as => 'target' -- libgit2 0.21.2