Conversation
|
Hello! Are there any plans to integrate this? |
|
I like these changes. Right now they break some of the assumptions in CI. I'm reluctant to merge a change that breaks CI but since I've never used Travis I'm not in a position to change the test to reflect the new generated code right now. Although the two-level class hierarchy isn't needed with Swift, I wonder if you'd consider an alternate version of this PR that made most of the same changes but kept the same class hierarchy? |
|
I've been using these templates for so long now, I don't see moving back to multiple classes. I would not have time to use/test them properly in actual code. |
|
OK that's fair. I'm trying to get a new release ready and I'd like to merge as many useful things as possible. I'm not sure how to handle this one yet-- it's good stuff that I'd like to include, but I'll need to investigate the project CI a bit first. Thanks for the PR. |
|
For anyone who's interested, I'm working on getting this merged, and I'll modify the tests to make it pass. The problem with currently-failing tests is not changing from two classes to class+extension, but a couple of easily corrected errors. However, the one thing I'm getting hung up on is the fact that this PR puts generated initializer code into the human-editable Swift file. I get why that was done, but at the same time I really think that generated code needs to be kept out of that file. I'm trying to see what I can do to resolve this, to get the improved Swiftiness while still keeping a clear division between generated and editable source files. |
|
Changes from this PR have been incorporated into #373. Thanks a ton, @radianttap! |
|
Also, this PR added |
Summary of Changes
This is extensive rewrite of the Swift templates. Highlights:
_ModelClasssubclass, no need for it in SwiftModelClassin human template + extension in machine templateNSSetwith properSet<ModelClass>func entityName()tovar entityNameadd*andremove*methods since they are not needed when Set is presentstructwithstatic letString constants, to avoid use of.rawValueall over the codeModelClass.Attributes.xxxAddresses
None. Simply an improvement over existing stuff.