diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-18 13:26:20 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-18 13:26:20 +0000 |
commit | 062fbeae80477b8e5a95b2e5222f98b7e94c70b7 (patch) | |
tree | 45a191c0bf65a6f3556cf71e99981a8595fa04a3 /app | |
parent | 5eed64b8488ac1f45537f9d8cb36a811921f7794 (diff) | |
download | redmine-062fbeae80477b8e5a95b2e5222f98b7e94c70b7.tar.gz redmine-062fbeae80477b8e5a95b2e5222f98b7e94c70b7.zip |
Makes models #initialize accept additional arguments.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8287 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/custom_field.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/models/query.rb | 2 | ||||
-rw-r--r-- | app/models/user_preference.rb | 2 |
4 files changed, 4 insertions, 4 deletions
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 |