##// END OF EJS Templates
Makes models #initialize accept additional arguments....
Jean-Philippe Lang -
r8167:062fbeae8047
parent child
Show More
@@ -30,7 +30,7 class CustomField < ActiveRecord::Base
30 30 validate :validate_values
31 31 before_validation :set_searchable
32 32
33 def initialize(attributes = nil)
33 def initialize(attributes=nil, *args)
34 34 super
35 35 self.possible_values ||= []
36 36 end
@@ -95,7 +95,7 class Project < ActiveRecord::Base
95 95 end
96 96 }
97 97
98 def initialize(attributes = nil)
98 def initialize(attributes=nil, *args)
99 99 super
100 100
101 101 initialized = (attributes || {}).stringify_keys
@@ -163,7 +163,7 class Query < ActiveRecord::Base
163 163 }
164 164 }
165 165
166 def initialize(attributes = nil)
166 def initialize(attributes=nil, *args)
167 167 super attributes
168 168 self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
169 169 end
@@ -23,7 +23,7 class UserPreference < ActiveRecord::Base
23 23
24 24 before_save :set_others_hash
25 25
26 def initialize(attributes = nil)
26 def initialize(attributes=nil, *args)
27 27 super
28 28 self.others ||= {}
29 29 end
General Comments 0
You need to be logged in to leave comments. Login now