# File lib/active_record/base.rb, line 2278 def initialize(attributes = nil) @attributes = attributes_from_column_definition @attributes_cache = {} @new_record = true ensure_proper_type self.attributes = attributes unless attributes.nil? self.class.send(:scope, :create).each { |att,value| self.send("#{att}=", value) } if self.class.send(:scoped?, :create) result = yield self if block_given? callback(:after_initialize) if respond_to_without_attributes?(:after_initialize) result end