summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/user.rb6
-rw-r--r--app/models/web_hook.rb11
-rw-r--r--db/schema.rb12
-rw-r--r--spec/models/user_spec.rb1
-rw-r--r--spec/models/web_hook_spec.rb11
5 files changed, 29 insertions, 12 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 8b136de90cf..a13a6f77870 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -34,6 +34,11 @@ class User < ActiveRecord::Base
:foreign_key => :assignee_id,
:dependent => :destroy
+ validates :projects_limit,
+ :presence => true,
+ :numericality => {:greater_than_or_equal_to => 0}
+
+
before_create :ensure_authentication_token
alias_attribute :private_token, :authentication_token
scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }
@@ -82,5 +87,6 @@ end
# linkedin :string(255) default(""), not null
# twitter :string(255) default(""), not null
# authentication_token :string(255)
+# dark_scheme :boolean default(FALSE), not null
#
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb
index 0058bd57b91..40b930c3a98 100644
--- a/app/models/web_hook.rb
+++ b/app/models/web_hook.rb
@@ -18,3 +18,14 @@ class WebHook < ActiveRecord::Base
# There was a problem calling this web hook, let's forget about it.
end
end
+# == Schema Information
+#
+# Table name: web_hooks
+#
+# id :integer not null, primary key
+# url :string(255)
+# project_id :integer
+# created_at :datetime
+# updated_at :datetime
+#
+
diff --git a/db/schema.rb b/db/schema.rb
index 7f3264cc173..3014579c16f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -13,18 +13,6 @@
ActiveRecord::Schema.define(:version => 20111220190817) do
- create_table "features", :force => true do |t|
- t.string "name"
- t.string "branch_name"
- t.integer "assignee_id"
- t.integer "author_id"
- t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "version"
- t.integer "status", :default => 0, :null => false
- end
-
create_table "issues", :force => true do |t|
t.string "title"
t.integer "assignee_id"
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 3a3ac7c9c80..a62e56cdd30 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -65,5 +65,6 @@ end
# linkedin :string(255) default(""), not null
# twitter :string(255) default(""), not null
# authentication_token :string(255)
+# dark_scheme :boolean default(FALSE), not null
#
diff --git a/spec/models/web_hook_spec.rb b/spec/models/web_hook_spec.rb
index e73e554adbb..309bfc0fd53 100644
--- a/spec/models/web_hook_spec.rb
+++ b/spec/models/web_hook_spec.rb
@@ -52,3 +52,14 @@ describe WebHook do
end
end
end
+# == Schema Information
+#
+# Table name: web_hooks
+#
+# id :integer not null, primary key
+# url :string(255)
+# project_id :integer
+# created_at :datetime
+# updated_at :datetime
+#
+