Skip to content

Loading…

define NilClass#blank? only if not defined yet #353

Merged
merged 1 commit into from

2 participants

@amatsuda

NilClass version of ac3af64, as this overwrites existing NilClass#blank? added by ActiveSupport, and spreads warnings when running Rails apps with -w flag.

@arunagw arunagw merged commit a4f1286 into mikel:master
@arunagw
Collaborator

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 14, 2012
  1. @amatsuda
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/mail/core_extensions/nil.rb
View
6 lib/mail/core_extensions/nil.rb
@@ -3,8 +3,10 @@
# This is not loaded if ActiveSupport is already loaded
class NilClass #:nodoc:
- def blank?
- true
+ unless nil.respond_to? :blank?
+ def blank?
+ true
+ end
end
def to_crlf
Something went wrong with that request. Please try again.