     }
     
     /**
-     Finds all records for given attributes. Generic version.
-     
-     :param: attributes Dictionary of attribute names and values.
-     :param: predicateType If not specified, `.AndPredicateType` will be used.
-     :param: sortDescriptors Sort descriptors.
-     :param: context If not specified, `defaultContext` will be used.
-     
-     :returns: Optional array of `Self` instances.
-     */
+        Finds all records for given attributes. Generic version.
+
+        :param: attributes Dictionary of attribute names and values.
+        :param: predicateType If not specified, `.AndPredicateType` will be used.
+        :param: sortDescriptors Sort descriptors.
+        :param: context If not specified, `defaultContext` will be used.
+
+        :returns: Optional array of `Self` instances.
+    */
     class func allWithAttributes<T>(attributes: [NSObject : AnyObject], predicateType: NSCompoundPredicateType = defaultPredicateType, sortDescriptors: [NSSortDescriptor]? = nil, context: NSManagedObjectContext = AERecord.defaultContext) -> [T]? {
         let objects: [NSManagedObject]? = allWithAttributes(attributes, predicateType: predicateType, sortDescriptors: sortDescriptors, context: context)
         return objects?.map { $0 as! T }

    }
    
    /**
     Finds the first record ordered by given attribute. Generic version.
     
     :param: name Attribute name.
     :param: ascending A Boolean value.
     :param: context If not specified, `defaultContext` will be used.
     
     :returns: Optional instance of `Self`.
     */
    class func firstOrderedByAttribute<T>(name: String, ascending: Bool = true, context: NSManagedObjectContext = AERecord.defaultContext) -> T? {
        let object: NSManagedObject? = firstOrderedByAttribute(name, ascending: ascending, context: context)
        return object as? T

    }
    
    /**
        Finds the first record for given attribute and value. Generic version.

        :param: attribute Attribute name.
        :param: value Attribute value.
        :param: sortDescriptors Sort descriptors.
        :param: context If not specified, `defaultContext` will be used.

        :returns: Optional object of `Self`.
     */
    class func firstWithAttribute<T>(attribute: String, value: AnyObject, sortDescriptors: [NSSortDescriptor]? = nil, context: NSManagedObjectContext = AERecord.defaultContext) -> T? {
        let object: NSManagedObject? = firstWithAttribute(attribute, value: value, sortDescriptors: sortDescriptors, context: context)
        return object as? T
