Browse files

Lazy initialize ActionPack Errors.

An extra initializer isn't necessary, and just adds additional
complications.
  • Loading branch information...
1 parent 2e6080d commit 6e14428dd218cd849ea7e3579bb11898ac0a4bed @elliotcm committed Mar 27, 2010
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/document/active_model_compliance.rb
View
7 lib/document/active_model_compliance.rb
@@ -31,13 +31,8 @@ def destroyed?
@_id.nil?
end
- def initialize
- @errors = ActiveModel::Errors.new(self)
- super
- end
-
def errors
- @errors
+ @errors ||= ActiveModel::Errors.new(self)
end
def self.included(doc_class)

0 comments on commit 6e14428

Please sign in to comment.