Permalink
Browse files

no need to check for nil?

  • Loading branch information...
1 parent 692f518 commit 08a08d97dd1307ab9544cc55fbd398c6acdc4c89 Neeraj Singh committed with tenderlove Sep 29, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/form_helper.rb
@@ -1015,7 +1015,7 @@ def value_before_type_cast(object)
module ClassMethods
def value(object, method_name)
- object.send method_name unless object.nil?
+ object.send method_name if object
end
def value_before_type_cast(object, method_name)
@@ -1055,7 +1055,7 @@ def radio_button_checked?(value, checked_value)
private
def add_default_name_and_id_for_value(tag_value, options)
- unless tag_value.nil?
+ if tag_value
pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/[^-\w]/, "").downcase
specified_id = options["id"]
add_default_name_and_id(options)

0 comments on commit 08a08d9

Please sign in to comment.