Makes models #initialize accept additional arguments.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8287 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
5eed64b848
commit
062fbeae80
|
@ -30,7 +30,7 @@ class CustomField < ActiveRecord::Base
|
||||||
validate :validate_values
|
validate :validate_values
|
||||||
before_validation :set_searchable
|
before_validation :set_searchable
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
def initialize(attributes=nil, *args)
|
||||||
super
|
super
|
||||||
self.possible_values ||= []
|
self.possible_values ||= []
|
||||||
end
|
end
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
def initialize(attributes=nil, *args)
|
||||||
super
|
super
|
||||||
|
|
||||||
initialized = (attributes || {}).stringify_keys
|
initialized = (attributes || {}).stringify_keys
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Query < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
def initialize(attributes=nil, *args)
|
||||||
super attributes
|
super attributes
|
||||||
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ class UserPreference < ActiveRecord::Base
|
||||||
|
|
||||||
before_save :set_others_hash
|
before_save :set_others_hash
|
||||||
|
|
||||||
def initialize(attributes = nil)
|
def initialize(attributes=nil, *args)
|
||||||
super
|
super
|
||||||
self.others ||= {}
|
self.others ||= {}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue