Skip to content
Snippets Groups Projects
Commit 09cdd943 authored by Drew Blessing's avatar Drew Blessing
Browse files

Fix serialize migration. Fixes #7734

parent 80174c16
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -17,7 +17,8 @@ class Service < ActiveRecord::Base
serialize :properties, JSON
 
default_value_for :active, false
default_value_for :properties, {}
after_initialize :initialize_properties
 
belongs_to :project
has_one :service_hook
Loading
Loading
@@ -32,6 +33,10 @@ class Service < ActiveRecord::Base
:common
end
 
def initialize_properties
self.properties = {} if properties.nil?
end
def title
# implement inside child
end
Loading
Loading
class SerializeServiceProperties < ActiveRecord::Migration
def change
add_column :services, :properties, :text
Service.reset_column_information
 
associations =
{
Loading
Loading
@@ -13,7 +14,7 @@ class SerializeServiceProperties < ActiveRecord::Migration
HipchatService: [:token, :room],
PivotaltrackerService: [:token],
SlackService: [:subdomain, :token, :room],
JenkinsService: [:token, :subdomain],
JenkinsService: [:project_url],
JiraService: [:project_url, :username, :password,
:api_version, :jira_issue_transition_id],
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment