Permalink
Browse files

optimized method for testing

  • Loading branch information...
1 parent c512235 commit d507726f78c544fedde9f0a49c75320f47f61062 Russell Norris committed Jan 29, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/lucky_sneaks/proxy_attributes_form_helpers.rb
@@ -21,7 +21,7 @@ module ProxyAttributesFormHelpers
# PS: If you have a better/shorter name for this, I'm all ears. :)
def proxy_attributes_check_box_tag(form_object_name, proxy_name, object_to_check, local_variable = false)
method_name = "#{form_object_name}[#{proxy_name}][]"
- parent = local_variable && local_variables.include?(form_object_name.to_s) ? self.send(local_variable) : instance_variable_get("@#{form_object_name}")
+ parent = local_variable ? self.send(form_object_name) : instance_variable_get("@#{form_object_name}")
checked_value = parent.send(proxy_name).include?(object_to_check.id)
tag = check_box_tag method_name, object_to_check.id, checked_value
if previous_check_box_exists_for[method_name]

0 comments on commit d507726

Please sign in to comment.