Skip to content

Commit

Permalink
Merge pull request #2 from ryan-mannion-zocdoc/RDM_2020_ManiTemplateC…
Browse files Browse the repository at this point in the history
…hanges

Reproduce Mani's mogenerator template changes
  • Loading branch information
ryan-mannion-zocdoc authored Jan 18, 2020
2 parents 915c366 + af525e8 commit ed7efda
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions templates/machine.swift.motemplate
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import CoreData

extension <$managedObjectClassName$> {

<$if (hasCustomSuperclass || (hasCustomSuperentity && TemplateVar.overrideBaseClass))$>override <$endif$>@objc public class var entityName: String {
// MARK: - Class methods

<$if (hasCustomSuperclass || (hasCustomSuperentity && TemplateVar.overrideBaseClass))$>override <$endif$>open class func entityName () -> String {
return "<$name$>"
}

<$if (hasCustomSuperclass || (hasCustomSuperentity && TemplateVar.overrideBaseClass))$>override <$endif$>public class func entity(managedObjectContext: NSManagedObjectContext) -> NSEntityDescription? {
return NSEntityDescription.entity(forEntityName: entityName, in: managedObjectContext)
<$if (hasCustomSuperclass || (hasCustomSuperentity && TemplateVar.overrideBaseClass))$>override <$endif$>@nonobjc
open class func fetchRequest() -> NSFetchRequest<<$name$>> {
return NSFetchRequest(entityName: self.entityName())
}

<$if noninheritedAttributes.@count > 0$>
Expand Down

0 comments on commit ed7efda

Please sign in to comment.