Skip to content

Commit

Permalink
no need to check for nil?
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj Singh authored and tenderlove committed Sep 30, 2010
1 parent 692f518 commit 08a08d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -1015,7 +1015,7 @@ def value_before_type_cast(object)


module ClassMethods module ClassMethods
def value(object, method_name) def value(object, method_name)
object.send method_name unless object.nil? object.send method_name if object
end end


def value_before_type_cast(object, method_name) def value_before_type_cast(object, method_name)
Expand Down Expand Up @@ -1055,7 +1055,7 @@ def radio_button_checked?(value, checked_value)


private private
def add_default_name_and_id_for_value(tag_value, options) 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 pretty_tag_value = tag_value.to_s.gsub(/\s/, "_").gsub(/[^-\w]/, "").downcase
specified_id = options["id"] specified_id = options["id"]
add_default_name_and_id(options) add_default_name_and_id(options)
Expand Down

0 comments on commit 08a08d9

Please sign in to comment.