C0 code coverage information
Generated on Tue Jun 09 17:50:06 +0900 2009 with
rcov 0.8.1.2
Code reported as executed by Ruby looks like
this... and this: this line is also marked as
covered. Lines considered as run by rcov, but
not reported by Ruby, look like this, and
this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not
executed.
1
require 'nested_ajax/pane' 2 3
module NestedAjax 4 module
Pane 5 class
AssociationPane < AbstractPane 6 attr_accessor :association_name 7 8 def initialize(template, form_or_object,
association_name, options = {}) 9 super(template, form_or_object, options) 10 @reflection =
object.class.reflections[association_name] 11 raise ArgumentError, "association not found -
#{association_name} for #{object.class.name}" unless @reflection
12 @association_name =
association_name 13
@associated_object = @object.send(@association_name) 14 @controller ||= @association_name
15 end 16 17 def pane_id 18 @pane_id ||= (options[:pane_id] ||
"#{object_name}_#{object.object_id}_#{association_name}")
19 end 20 21 def base_form_name 22 @base_form_name ||=
"#{object_name}[#{association_name}_attributes]" 23 end 24 25 private 26 27
def form_name_with_parent 28 parent ? 29
"#{parent.form_name}[#{association_name}_attributes]" :
30
"#{object_name}[#{association_name}_attributes]" 31 end 32 33 34
35 public 36 37 # 38
def association_foreign_key 39 reflection =
object.class.reflections[association_name.to_sym] 40 reflection.macro == :belongs_to ?
reflection.association_foreign_key : reflection.primary_key_name
41 end 42 43 end 44 end 45 end
Generated using the rcov
code coverage analysis tool for Ruby version 0.8.1.2.