Skip to content
This repository
Browse code

False is a reasonable default

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5793 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit d88e83f211e47a8fa8220c880cf7a7309e552503 1 parent c6d4780
David Heinemeier Hansson authored December 27, 2006
2  activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
@@ -19,7 +19,7 @@ class Module
19 19
   #   attr_accessor_with_default(:element_name) { name.underscore } 
20 20
   #
21 21
   def attr_accessor_with_default(sym, default = nil, &block)
22  
-    raise 'Default value or block required' unless default || block
  22
+    raise 'Default value or block required' unless !default.nil? || block
23 23
     define_method(sym, block_given? ? block : Proc.new { default })
24 24
     module_eval(<<-EVAL, __FILE__, __LINE__)
25 25
       def #{sym}=(value)

0 notes on commit d88e83f

Please sign in to comment.
Something went wrong with that request. Please try again.