Skip to content

Commit

Permalink
[#565] only autoset parent if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
al2o3cr committed Dec 3, 2009
1 parent d2b9428 commit acd8ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hobo/lib/hobo/view_hints.rb
Expand Up @@ -36,7 +36,7 @@ def self.setter(name, default=nil, &block)
child_model = model.reflections[args.first].klass
if child_model.view_hints.parent.nil? and !child_model.view_hints.parent_defined
parent = model.reverse_reflection(args.first)
child_model.view_hints.parent(parent.name, :undefined => true)
child_model.view_hints.parent(parent.name, :undefined => true) if parent
end
args
end
Expand Down

0 comments on commit acd8ef0

Please sign in to comment.