lib/trust/controller/resource.rb in trust-0.6.2 vs lib/trust/controller/resource.rb in trust-0.6.3
- old
+ new
@@ -248,10 +248,10 @@
# if association is named prizes, then that association is returned
#
def relation(associated_resource)
if associated_resource && associated_resource.object
name = associated_resource.as || plural_name
- associated_resource.klass.reflect_on_association(name) ?
+ associated_resource.object.class.reflect_on_association(name) ?
associated_resource.object.send(name) : associated_resource.object.send(klass.to_s.demodulize.underscore.pluralize)
else
klass
end
end