diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-12-19 15:00:29 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-12-19 15:18:09 +0100 |
commit | c5edb54175be630d973a3a994e6cb44c46d3edfb (patch) | |
tree | de9aee036f00cfb2ce10a7d0d02ffa5035564cd3 /sonar-server/src/main/webapp/WEB-INF/app/models | |
parent | 610521d0c0b66af51935816efdcaa63b2da709ad (diff) | |
download | sonarqube-c5edb54175be630d973a3a994e6cb44c46d3edfb.tar.gz sonarqube-c5edb54175be630d973a3a994e6cb44c46d3edfb.zip |
SONAR-983 first implementation of the search engine of projects, directories and files
* The POST request to the URL /search/reset starts the indexation of resources
* The search engine is available at /search
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/models')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb new file mode 100644 index 00000000000..1db1a1cd361 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/resource_index.rb @@ -0,0 +1,30 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2011 SonarSource +# mailto:contact AT sonarsource DOT com +# +# Sonar is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Sonar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with Sonar; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +# +class ResourceIndex < ActiveRecord::Base + + set_table_name 'resource_index' + + belongs_to :resource, :class_name => 'Project', :foreign_key => 'resource_id' + belongs_to :project, :class_name => 'Project', :foreign_key => 'project_id' + + def resource_id_for_authorization + project_id + end +end
\ No newline at end of file |