motion/cdq.rb in cdq-0.1.10 vs motion/cdq.rb in cdq-0.1.11

- old
+ new

@@ -51,11 +51,13 @@ case obj when Class if obj.isSubclassOfClass(NSManagedObject) entities = NSDictionary.dictionaryWithDictionary( @@base_object.models.current.entitiesByName) + entity_name = obj.name.split("::").last + # NOTE attempt to look up the entity entity_description = - entities[obj.name] || + entities[entity_name] || entities[obj.ancestors[1].name] if entity_description.nil? raise "Cannot find an entity named #{obj.name}" end CDQTargetedQuery.new(entity_description, obj)