]> source.dussan.org Git - redmine.git/commitdiff
Removed after_initialize methods.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 18 Dec 2011 14:57:58 +0000 (14:57 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 18 Dec 2011 14:57:58 +0000 (14:57 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8288 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/auth_source_ldap.rb
app/models/custom_value.rb
app/models/document.rb
app/models/issue.rb
app/models/issue_relation.rb
app/models/query.rb
app/models/time_entry.rb
app/models/wiki_page.rb

index b7ab0cf3098dd4a8e506144974697b31bd5cc0f1..76b1c25f449ec98f001f0a04d8abeec5e91e2952 100644 (file)
@@ -27,7 +27,8 @@ class AuthSourceLdap < AuthSource
 
   before_validation :strip_ldap_attributes
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     self.port = 389 if self.port == 0
   end
 
index dae8f73ef3672c220bce2be290ccae5290e2b7ee..6cb4853f9d8b3214aed45668ace1947dbf03c5b2 100644 (file)
@@ -21,7 +21,8 @@ class CustomValue < ActiveRecord::Base
 
   validate :validate_custom_value
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record? && custom_field && (customized_type.blank? || (customized && customized.new_record?))
       self.value ||= custom_field.default_value
     end
index f8ea92a1174ca1a365ced4436f28a9e023f978e9..208b1087636f7135824ba5fa468373eabdff1ad7 100644 (file)
@@ -36,7 +36,8 @@ class Document < ActiveRecord::Base
     !user.nil? && user.allowed_to?(:view_documents, project)
   end
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record?
       self.category ||= DocumentCategory.default
     end
index 199efe1190838b296e7c896cce4c0899fff6e1e3..aa1a3b93cc1ad2a5a86f27c015f043bdb8f71faa 100644 (file)
@@ -124,7 +124,8 @@ class Issue < ActiveRecord::Base
     end
   end
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record?
       # set default values for new records only
       self.status ||= IssueStatus.default
index 854e4255b1301446d67880f1d9cf40d9aa96ce11..28b525ff50517e387d5643ae1a942d9f9b17f44f 100644 (file)
@@ -57,7 +57,8 @@ class IssueRelation < ActiveRecord::Base
         (issue_to.nil? || user.allowed_to?(:manage_issue_relations, issue_to.project)))
   end
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record?
       if relation_type.blank?
         self.relation_type = IssueRelation::TYPE_RELATES
index 4cd8d36b908a7a2fb1d7cd6838f34d2cba16fbff..262a738d19f3fb7599ff41eacd8c22b3112dce2d 100644 (file)
@@ -166,10 +166,6 @@ class Query < ActiveRecord::Base
   def initialize(attributes=nil, *args)
     super attributes
     self.filters ||= { 'status_id' => {:operator => "o", :values => [""]} }
-  end
-
-  def after_initialize
-    # Store the fact that project is nil (used in #editable_by?)
     @is_for_all = project.nil?
   end
 
index c5c1d39bc3fb7625881bdcaebd84a8866f81e557..caa1019e511b5fbfbe12981be36818329d8e7572 100644 (file)
@@ -65,7 +65,8 @@ class TimeEntry < ActiveRecord::Base
     end
   }
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record? && self.activity.nil?
       if default_activity = TimeEntryActivity.default
         self.activity_id = default_activity.id
index 92b72af8f9750018aadebfe88d708fa0f7b3f886..c6e5f21ed31d1bc01c153233319e076da1cb4caa 100644 (file)
@@ -55,7 +55,8 @@ class WikiPage < ActiveRecord::Base
   # Wiki pages that are protected by default
   DEFAULT_PROTECTED_PAGES = %w(sidebar)
 
-  def after_initialize
+  def initialize(attributes=nil, *args)
+    super
     if new_record? && DEFAULT_PROTECTED_PAGES.include?(title.to_s.downcase)
       self.protected = true
     end