diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb index 09cb03471..87285ed66 100644 --- a/app/models/custom_field.rb +++ b/app/models/custom_field.rb @@ -30,7 +30,7 @@ class CustomField < ActiveRecord::Base validate :validate_values before_validation :set_searchable - def initialize(attributes = nil) + def initialize(attributes=nil, *args) super self.possible_values ||= [] end diff --git a/app/models/project.rb b/app/models/project.rb index 831bdf07f..0d2dfc29c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -95,7 +95,7 @@ class Project < ActiveRecord::Base end } - def initialize(attributes = nil) + def initialize(attributes=nil, *args) super initialized = (attributes || {}).stringify_keys diff --git a/app/models/query.rb b/app/models/query.rb index fad42fcb2..4cd8d36b9 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -163,7 +163,7 @@ class Query < ActiveRecord::Base } } - def initialize(attributes = nil) + def initialize(attributes=nil, *args) super attributes self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} } end diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb index b2da867a3..836ec6b26 100644 --- a/app/models/user_preference.rb +++ b/app/models/user_preference.rb @@ -23,7 +23,7 @@ class UserPreference < ActiveRecord::Base before_save :set_others_hash - def initialize(attributes = nil) + def initialize(attributes=nil, *args) super self.others ||= {} end