lib/og/relation.rb in og-0.19.0 vs lib/og/relation.rb in og-0.20.0
- old
+ new
@@ -98,21 +98,23 @@
# stored as symbols. These symbols are resolved by this
# method.
#--
# FIXME: do something more elegant here.
#++
-
+
def resolve_target
if target_class.is_a?(Symbol)
c = owner_class.name.dup
c = "::" + c unless c =~ /::/
c.gsub!(/::.*$/, '::')
c << target_class.to_s
begin
klass = constant(c)
rescue
- c = target_class
- retry
+ unless c == target_class
+ c = target_class
+ retry
+ end
end
@options[:target_class] = klass
end
end