diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-09 14:36:25 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-09 14:36:25 +0400 |
commit | c5cdd07899df5cc5d87c514a7649979056fcced7 (patch) | |
tree | 770bc3a810a53d25fee9685a9a498b9be5537cc5 /app/models | |
parent | 9a02e27b84589856b41e171493aa441add497ac1 (diff) |
Add values to default fields to prevent 500 error when migrate from MySQL to Postgres
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/note.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/models/user.rb | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 906de4855ab..d666d5d52c8 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -23,6 +23,8 @@ require 'file_size_validator' class Note < ActiveRecord::Base include Mentionable + default_value_for :system, false + attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id, :attachment, :line_code, :commit_id attr_mentionable :note diff --git a/app/models/project.rb b/app/models/project.rb index 386ab542a68..09642ffa22f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -29,6 +29,12 @@ class Project < ActiveRecord::Base extend Enumerize default_value_for :archived, false + default_value_for :issues_enabled, true + default_value_for :wall_enabled, false + default_value_for :merge_requests_enabled, true + default_value_for :wiki_enabled, true + default_value_for :snippets_enabled, false + default_value_for :imported, false ActsAsTaggableOn.strict_case_match = true diff --git a/app/models/user.rb b/app/models/user.rb index 58d90f03b34..c25dcb074a1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -49,6 +49,11 @@ require 'carrierwave/orm/activerecord' require 'file_size_validator' class User < ActiveRecord::Base + default_value_for :admin, false + default_value_for :can_create_group, true + default_value_for :can_create_team, false + default_value_for :hide_no_ssh_key, false + devise :database_authenticatable, :token_authenticatable, :lockable, :async, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable |