From 212f400d678d75068ae1a5c57110f273464e6ec1 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 3 Jan 2012 23:39:03 +0200 Subject: [PATCH] fix bug #322 --- app/models/user.rb | 6 ++++++ app/models/web_hook.rb | 11 +++++++++++ db/schema.rb | 12 ------------ spec/models/user_spec.rb | 1 + spec/models/web_hook_spec.rb | 11 +++++++++++ 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8b136de9..a13a6f77 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 0058bd57..40b930c3 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 7f3264cc..3014579c 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 3a3ac7c9..a62e56cd 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 e73e554a..309bfc0f 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 +# +