aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-03-28 14:01:13 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-03-28 14:01:13 +0200
commit9f7cdba5e642faa17cb556f2b7882d7dd5adab0c (patch)
tree3bc4a39b13eb82c063d96770add5e86230c09f46 /sonar-server
parent951baafb0e59ece643cefd2317582da5609abed6 (diff)
downloadsonarqube-9f7cdba5e642faa17cb556f2b7882d7dd5adab0c.tar.gz
sonarqube-9f7cdba5e642faa17cb556f2b7882d7dd5adab0c.zip
Add activerecord model for AUTHORS
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/author.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/author.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/author.rb
new file mode 100644
index 00000000000..ee0d86efc03
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/author.rb
@@ -0,0 +1,31 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 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 Author < ActiveRecord::Base
+
+ belongs_to :person, :class_name => 'Project', :foreign_key => 'person_id'
+
+ validates_uniqueness_of :login
+ validates_presence_of :person
+ validates_length_of :login, :allow_blank => false, :maximum => 100
+
+ def <=>(other)
+ login<=>other.login
+ end
+end \ No newline at end of file