Commit c5cdd07899df5cc5d87c514a7649979056fcced7
1 parent
9a02e27b
Exists in
spb-stable
and in
3 other branches
Add values to default fields to prevent 500 error when migrate from MySQL to Postgres
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
13 additions
and
0 deletions
Show diff stats
app/models/note.rb
... | ... | @@ -23,6 +23,8 @@ require 'file_size_validator' |
23 | 23 | class Note < ActiveRecord::Base |
24 | 24 | include Mentionable |
25 | 25 | |
26 | + default_value_for :system, false | |
27 | + | |
26 | 28 | attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id, |
27 | 29 | :attachment, :line_code, :commit_id |
28 | 30 | attr_mentionable :note | ... | ... |
app/models/project.rb
... | ... | @@ -29,6 +29,12 @@ class Project < ActiveRecord::Base |
29 | 29 | extend Enumerize |
30 | 30 | |
31 | 31 | default_value_for :archived, false |
32 | + default_value_for :issues_enabled, true | |
33 | + default_value_for :wall_enabled, false | |
34 | + default_value_for :merge_requests_enabled, true | |
35 | + default_value_for :wiki_enabled, true | |
36 | + default_value_for :snippets_enabled, false | |
37 | + default_value_for :imported, false | |
32 | 38 | |
33 | 39 | ActsAsTaggableOn.strict_case_match = true |
34 | 40 | ... | ... |
app/models/user.rb
... | ... | @@ -49,6 +49,11 @@ require 'carrierwave/orm/activerecord' |
49 | 49 | require 'file_size_validator' |
50 | 50 | |
51 | 51 | class User < ActiveRecord::Base |
52 | + default_value_for :admin, false | |
53 | + default_value_for :can_create_group, true | |
54 | + default_value_for :can_create_team, false | |
55 | + default_value_for :hide_no_ssh_key, false | |
56 | + | |
52 | 57 | devise :database_authenticatable, :token_authenticatable, :lockable, :async, |
53 | 58 | :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable |
54 | 59 | ... | ... |